What is a better approach ? I assume i am hitting an issue with GET/POST
I get this as a JS error:A Runtime Error has occurred.Do you wish to DebugLine:1 Error Expected ')'When I open it up in a debugger, I get the onload statement:<body onload="javascript:parent.getScriptFrame().setHotelListFromMain('10 K characters')">There are no apostrophes, quotes or parens in the data I truncated. There are slashes, :, and UTF-8 &.Interestingly enough larger ones work on my laptop (VMWARE image) with 6.7.1 SP1 Beta. The server it is failing on is 6.7.1 Win 2003.It could be a Java string issue as you said. Can you pass an array from Perl to JS ? I could separate individual fields by commas. That would be a pain.Andy
//--------------------------------------------------------------------------------------// FormAPI (Client Side)//--------------------------------------------------------------------------------------var HotelList = new Array;. . .setHotelListFromMain(currentEntry) { HotelList[HotelList.length] = currentEntry;}#---------------------------------------------------------------------------------------# From the server side, generate something like that:#---------------------------------------------------------------------------------------print "Content-type: text/html\n\n";my $page = <<END_PAGE;<html><head><script type="text/javascript" language="javascript"> var api = parent.getScriptFrame(); if (api) { api.setHotelListFromMain('Entry0'); api.setHotelListFromMain('Entry1'); ... api.setHotelListFromMain('EntryN'); } else { alert("Oh, Oh..."); }</script></head><body></body></html>END_PAGEprint $page;
I only write bits of JavaScript twice a year - so at the risk of sounding stupid - why not prepare the names & locations as Array in the callserver part, and pass the 2 Array object to the JS callback function?