View Full Version : Why won't this work?
WaldoUK
06-27-2002, 12:09 AM
I am using a perl based search script that is "included" on the page via some Javascript. However, even copying and pasting the code directly produces Javascript errors and I have no idea why? (I have tried creating functions, etc to get round this, but I'm not exactly Mr Knowledgeable when it comes to javascript!)
The code is:
<script language=javascript src="http://www.somedomain.com/cgi-bin/csSearchpro/csSearchPro.cgi?js=Y"></script>
That is put on the part of the page where I want the search script to appear. On trying the page (which contains no other javascript code) I get an error (using IE6) regarding an "unterminated string constant" on Line 2, Character 23 (the only thing on line 2 is <head>. The javascript above is on line 137).
Can anyone suggest why this is happening? I know this is a javascript issue, as the search script can be accessed directly and is working. I'm tearing my hair out :(
Thanks for reading :thumbsup:
adios
06-27-2002, 12:27 AM
You're not related to 'Lee Brenner' are you?
Hard to tell, but it sounds a bit like you're trying to embed an HTML page via Javascript. This can be done, but only by treating the HTML as JS string data. Forget IE line numbers; they're notoriously misleading. What's in that file?
Lee Brenner
06-27-2002, 12:33 AM
I believe the error message is being generated as IE parses the include file (I could be wrong), which is why the line number doesn't make any sense. Did you look at line 2 of the include?
No relation, but it is odd we chose the exact same post titles.
WaldoUK
06-27-2002, 12:41 AM
Nope, no relation, but the same subject line is a bit spooky ;)
It's not really an attempt to embed an HTML page, more just this search function. When it works (and it has worked in the past!) what magically appears is a form box and a search button. The actual search script that I'm trying to call is pretty complex, but that is all that is created when it works.
Oh, the other strange thing is this... when I visit the page and view the source the include is just sitting there. In the past when this hasn't worked (getting a recurring theme here? :D) the place where the include should be is just nothing. Now, it's as if IE6 is tripping up beforehand and just leaving the code there?
Still tearing my hair out though! :(
WaldoUK
06-28-2002, 12:19 AM
Anyone else have suggestions for this? I've installed a debugger add on tool to IE6, and on running the javascript it states "! ERROR : Syntax error". As I've said, this is strange as it worked fine before. Does anyone think it may be the Perl script to blame? (Perhaps a re-install called for?) Or is there something else up?
justame
06-28-2002, 12:51 AM
wal...
whennn you just a say® ...include file??? ummm doesnt your page thattt the code is on havvve to be just a named® with the extention of ... shtml ??? n' ifin' thattts the case??? is yours??? lol...
just a guessing® ...
WaldoUK
06-28-2002, 05:10 AM
Problem sorted (at last!) It was entirely the fault of the perl script.. I'm not quite sure what file in the set-up was dodgy, but one of them was. It was causing the rather confusing effects of the script still working on it's own directly, but not working when included in any fashion whatsoever.
I'm just glad that's sorted... thanks for the support though guys :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.