2009/6/3 Tyler Knappe <[email protected]>:
>
> Philip Hallstrom wrote:
>> On Jun 2, 2009, at 2:23 PM, Tyler Knappe wrote:
>>
>>>        var next_week = 0;
>>>
>>> <script src="/javascripts/test.js?1243524559"
>>> type="text/javascript"></script>
>>>
>>> However, it never seems to call the function resulting in the alert.
>>>
>>> Anyone see something wrong?
>>
>>   alert('Next week' + next-week);
>>                       ^^^^^^^^^
>>
>> That should be "next_week".
>>
>> Odds are you're getting a JS error, but not seeing it.  Turn on
>> whatever debugging you might have (firebug in firefox, or safari's
>> debug inspector) and it will make this easy to catch.
>>
>> -philip
>
> I fixed this and turned on firebug.
>
> I am now seeing the following error:
>
> missing } in XML expression
> [Break on this error] alert('test');\n
>
> I tried just the following to simplify things:
>
> <script type="text/javascript">
>        //var next_week = 0;
>        function testjs()
>        {
>        }
>
>                //next_week = next_week + 1;
>                //alert("next_week");
>                //alert('test');
>                //return next_week;
>        //}
> </script>
>
> Which calls an empty function.
>
> Now I am seeing the following:
>
> syntax error
> [Break on this error] }\n
>
> Why is this the case?  How could there be a syntax error?

I don't know why the syntax error, but if I had this problem I would
keep deleting stuff till it goes away, then add it back to find
exactly the problem.  I have pasted your script into a page of mine
and it does not give an error. Which line is the error reported on?
Are you sure the script is not inside another tag that is confusing
it? Try moving it out to the top level.  Keep trying things till the
error goes away then work out what causes it.

Colin

> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to