Hi,

I observed a problem with the execution of javascript:

In my HTML page there is a link with a href executing some javascript:
<a title ="Upload" class="roundbutton"  
href="javascript:{%20document.getElementById('hidden_p_action').value='Upload';%20submitForm(this);}"
 ><span>Upload</span> </a>

If I click this link from WebTest like
<clickLink 
href="javascript:{%20document.getElementById('hidden_p_action').value='Cancel';%20submitForm(this);}"/>
I get this error:
JavaScript error loading page http://...: syntax error (javascript url#380)

...pointing to line 380 with the javascript.


This seems to be due to the '%20' in the source's URL. At least after removal 
of '%20' in the source this worked fine (opening the correct page):
<clickLink 
href="javascript:{document.getElementById('hidden_p_action').value='Upload';submitForm(this);}"/>

Since I'm not in a position to remove the %20 in all JavaScripts in our pages 
my questions are:
1. Am I right with my analysis? (And has anybody else made the same 
observation?)
2. Any ideas how to fix or cope with this?

Thanks a lot, regards
Michael

Reply via email to