Urban pro

View My Profile

Monday, May 21, 2012

Java Script Error : Error: Expected 'j'


Java Script Error : Error: Expected 'j' :

Hi friends,

Here i am again with another piece of error that i encountered while scripting in java script .

Once I was using an alert and I got this error :  Error: Expected 'j' .

My alert statement was :

alert("Don't  skip but read the whole paragraph .");

Reason : This happened because, the apostrophe is a special character and as such to treat it as a normal character we need to escape it using back slash --> "\" .

So, the alert was re written as :

alert("Don\'t  skip but read the whole paragraph  .");

And voila, it started working properly .

Goodbye .
Have a nice day .

No comments:

Post a Comment