Web Analytics Made Easy -
StatCounter Why won't this work? - CodingForum


No announcement yet.

Why won't this work?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Why won't this work?

    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

  • #2
    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?


    • #3
      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.


      • #4
        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? ) 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!


        • #5
          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?


          • #6
            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® ...
            The New JustaBuster Version 2.0 OR JustaBusta Lite V2.0
            ...just a special® thanx kinda hugs to jkd n' nex ...:O)))

            CommemorateWTC.com --Please lend your support


            • #7
              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