Saturday, January 21, 2012

How to Detect Javascript is disabled or not ?

Hello friends, After a very long time I write this blog.

Today I got requirement from my friend that he wants to check javascript is enabled or not as the page load. And if javascript is disable then he wants to redirect to another page.

As many of you know that we can put "noscript" tag in the page to execute the code while javascript is disabled.


So i take noscript tag and put meta tag inside that to redirect to another page while javascript is disabled


Below is the code of the same.




Sunday, June 20, 2010

Test All IE version at Once

When start to delevope web application , the main point is how the application looks like in cross browser. Splecially for IE's different versions.

Currently i develope one application in my company, and the scope of the application was it should be compatible with IE-7,IE-8 and firefox 3.5 , so we develope the application design according to the requirement.

Suddenly client says that he wants application compatible with IE-6 also ,because most of his users are still using IE-6 .So from now i have to check all developed pages on all IE version. and the current version installed in my system is IE-7 , so every time i have to ask someone to check the page in his system to different version.

I am fade up with this , i search on net and come up with the solution
IE-Tester .You can check more detail regarding this tool at http://my-debugbar.com/wiki/IETester/HomePage You can also attach different tool with this and test your application with all IE version at once

Friday, June 19, 2009

Implementing Salesforce Login Solutuion With Flex 3

In this post, we will see how we can implement salesforce login with flex.



All you need is:
For the beginner steps for integration of flex toolkit for salesforce you can follow the steps given in below site

http://wiki.developerforce.com/index.php/Tutorial:_Creating_Flex_Salesforce_Mashups

While regarding the login method I will be describing as follows:

The namespaces to be included in flex builder for login are as follows:


[caption id="" align="alignnone" width="650" caption="namespace for flex to salesforce"]connectivity[/caption]


The Login function will be as follows:


[caption id="" align="alignnone" width="650" caption="Login method for flex to salesforce"]Login[/caption]

There is a common error while implementing login with salesforce, it will generate following error:


(com.salesforce.events::ApexFaultEvent)#0



bubbles = false

cancelable = true

context = (null)

currentTarget = (null)

eventPhase = 2

fault = (mx.rpc::Fault)#1

errorID = 0

faultCode = "Server.Error.Request"

faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://www.salesforce.com/services/Soap/u/11.0"]. URL: http://www.salesforce.com/services/Soap/u/11.0"

faultString = "HTTP request error"

message = "faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://www.salesforce.com/services/Soap/u/11.0"]. URL: http://www.salesforce.com/services/Soap/u/11.0'"

name = "Error"

rootCause = (flash.events::IOErrorEvent)#2

bubbles = false

cancelable = false

currentTarget = (flash.net::URLLoader)#3

bytesLoaded = 0

bytesTotal = 0

data = (null)

dataFormat = "text"

eventPhase = 2

target = (flash.net::URLLoader)#3

text = "Error #2032: Stream Error. URL: http://www.salesforce.com/services/Soap/u/11.0"

type = "ioError"

message = (mx.messaging.messages::ErrorMessage)#4

body = (Object)#5

clientId = "DirectHTTPChannel0"

correlationId = "026E48D3-1BFD-8AA6-A5D6-CDE8A1C8B7D8"

destination = ""

extendedData = (null)

faultCode = "Server.Error.Request"

faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://www.salesforce.com/services/Soap/u/11.0"]. URL: http://www.salesforce.com/services/Soap/u/11.0"

faultString = "HTTP request error"

headers = (Object)#6

messageId = "154CD995-435D-2011-47FB-CDE8A2A25895"

rootCause = (flash.events::IOErrorEvent)#2

timestamp = 0

timeToLive = 0

messageId = "154CD995-435D-2011-47FB-CDE8A2A25895"

target = (null)

token = (mx.rpc::AsyncToken)#7

message = (mx.messaging.messages::HTTPRequestMessage)#8

body = "<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/"><se:Header xmlns:sfns="urnartner.soap.sforce.com"/><se:Body><login xmlns="urnartner.soap.sforce.com" xmlns:ns1="sobject.partner.soap.sforce.com"><username>xxxxxxxx@xxxxxx.com</username>

<password>xxxxxxxxxxxxx9KYz1Hmt965XXXXQcNVpjaq61</password></login></se:Body></se:Envelope>"

clientId = (null)

contentType = "text/xml; charset=UTF-8"

destination = "DefaultHTTP"

headers = (Object)#9

DSEndpoint = "direct_http_channel"

httpHeaders = (Object)#10

Accept = "text/xml"

SOAPAction = """"

X-Salesforce-No-500-SC = "true"

messageId = "026E48D3-1BFD-8AA6-A5D6-CDE8A1C8B7D8"

method = "POST"

recordHeaders = false

timestamp = 0

timeToLive = 0

url = "http://www.salesforce.com/services/Soap/u/11.0"

responders = (Array)#11

[0] (::SalesForceResponder)#12

result = (null)

type = "fault"

Solution


The Flex security model will require that you are running this on https server, unless you specify "http" using connection.protocol();
If your server is not HTTPS, but is HTTP, you can set that on the connection.

In addition, you will need to pass a security token appended to your password unless you have enabled the IP range in your network configuration.

Both will generate the io error you see.


If you are using “HTTPS” then you have to specify


connectionprotocol = “https”



And make sure that in salesforce.com by default “Require secure connections (https)” is checked




[caption id="" align="alignnone" width="650" caption="Sales force security setting"]HTTPS[/caption]

But if you are using “http”, then you have to specify


connectionprotocol = “http”;


And make sure that in salesforce.com by default “Require secure connections (https)” is checked to false.




[caption id="" align="alignnone" width="650" caption="salesforce https setting"]HTTP[/caption]