logo

Response

« Return to the main article

You are viewing this page out of context. To see it in the context it is intended please click here.

About This Page

Reply posted by Tony Handscomb on Tue 13 Jan 2004 in response to Debugging JavaScript in Your Applications

JavaScript Errors

Hi Jake,
Thanks for the nice article. I do agree with you that Javascript is the most
cumbersome language of all. It can sometime takes days to find a solution for
certain problems. Cutting the long story short. I am struggling with a similar
javascript error. I have tried debugging and found the cause of problem but for
some reason couldn't find the solution. Please could you shed some light, it
would be great help


I have pasted the Javascript code below


"function chgPM(src) {" + @NewLine +
" var pm = src.options[src.selectedIndex].text;" + @NewLine +
" var path = \'sys_wv?OpenForm&View=" + view + "&Sort=" + sort +
"&Start=1&Count=" + CountNum +
"&Query=\' + pm;" + @NewLine +
" window.location.href = path; }"


This lets users select a name from dropdown list and append the name to the url
as a view search criteria and displays records with this name only. Which works
fine with names which doesn't have ' in them. As soon as it encounters a name
with apostrophe it startts failing and gives out weird error.


Thanks in advance.