Forum Moderators: open

Message Too Old, No Replies

javascript syntax error

javascript syntax error

         

babushka

8:50 pm on Feb 18, 2011 (gmt 0)

10+ Year Member



Hello, I am hopeless at javascript.

Firebug in firefox is giving me a syntax error for the strURL line below. The code is included in an external file.

I can't see what the problem is.



<script type="text/javascript">
function getCity(stateId) {
var strURL = "getcities.php?state="+stateId;
}

babushka

10:37 pm on Feb 18, 2011 (gmt 0)

10+ Year Member



I embed the code in the head and it works fine, no syntax error. Why can't I put it in a separate file?

Fotiman

1:55 am on Feb 19, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If it's in an external file, then you should NOT have the <script> and </script> tags in the file.

babushka

9:50 pm on Feb 19, 2011 (gmt 0)

10+ Year Member



Gee, I must've stared at that 20 times. Don't know how I missed it. Thanks!