Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    IE9 Javascript problem

    Hi All,

    I am desperately pulling my hair out... can you help me understand how I can resolve the below errors:

    SCRIPT1028: Expected identifier, string or number
    calender.js, line 318 character 17
    SCRIPT1006: Expected ')'
    blenheim-palace-lunch-cotswolds-p-170.html, line 88 character 35
    SCRIPT5007: The value of the property 'getStartDate' is null or undefined, not a Function object
    blenheim-palace-lunch-cotswolds-p-170.html, line 643 character 7

    For this web address... http://tinyurl.com/79msxqm

    What can I change to fix the issue? The site is working properly in all other browsers but not IE9.

    Hope you can help. Thanks.

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Location
    Texas
    Posts
    448
    Thanks
    24
    Thanked 63 Times in 63 Posts
    SCRIPT1028: Expected identifier, string or number
    calender.js, line 318 character 17
    selectedDate is the last in your series, and as such should not be followed by a comma
    change
    Code:
    selectedDate:sday,
    to
    Code:
    selectedDate:sday
    Allwisend bin ich nicht, doch viel ist mir bewursst
    -Goethe

  • Users who have thanked blaze4218 for this post:

    cclayton (03-07-2012)

  • #3
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you for that! It has fixed the issue which is such a relief. I dont suppose you know why I am still getting the error...

    SCRIPT1006: Expected ')'
    blenheim-palace-lunch-cotswolds-p-170.html, line 88 character 35

    Thanks again - it is much appreciated.

  • #4
    Senior Coder Logic Ali's Avatar
    Join Date
    Sep 2010
    Location
    London
    Posts
    1,028
    Thanks
    0
    Thanked 207 Times in 202 Posts
    Quote Originally Posted by cclayton View Post
    I dont suppose you know why I am still getting the error...

    SCRIPT1006: Expected ')'
    blenheim-palace-lunch-cotswolds-p-170.html, line 88 character 35
    Code:
    var today = new Date(2012,2,7 ,9:,9:,6);
    That's the line to which the error refers.

  • #5
    Regular Coder
    Join Date
    Apr 2005
    Location
    Texas
    Posts
    448
    Thanks
    24
    Thanked 63 Times in 63 Posts
    Code:
    		var today = new Date(2012,2,7 ,9:,5:,3);
    this is not how you create a date object. Date() will accept any legitimate format (of the many I have tested) as a parameter, including a time stamp. What you have done here is split the date into 6 parameters, two of which are not valid. you can not pass 9: as a parameter, you can however pass the string "9:" as a parameter. But even that would be incorrect for the Date object. Try

    Code:
    		var today = new Date("9:30:30 2012/2/7");
    Allwisend bin ich nicht, doch viel ist mir bewursst
    -Goethe

  • #6
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for the responses. This is dynamically populated, the actual JS that creates this is:

    function getStartDate() {
    var today = new Date();
    var sday = new Date(today.setDate(today.getDate()+2));
    //nullify hrs, mins, secs

    The link to the whole JS file is here: http://tinyurl.com/6ol5j8v

    Any assistance to rectifiy this would be hugely appreciated.

    Thanks!

  • #7
    Regular Coder
    Join Date
    Apr 2005
    Location
    Texas
    Posts
    448
    Thanks
    24
    Thanked 63 Times in 63 Posts
    I'm afraid the new link you have provided is irrelevant. The line
    Code:
    		var today = new Date(2012,2,8 ,7:,4:,1);
    is not dynamically generated by javascript. It is very real, and very present on your HTML page. It needs to be removed, or changed.
    If the line is dynamically generated on the server, then you need to fix your server code to prevent the HTML page from containing the error.

    When javascript dynamically generates javascript code, the generated code is not present when the user uses "view source", only the code to generate the code is visible. And since I can see the line in question, it was not "dynamically populated"
    Allwisend bin ich nicht, doch viel ist mir bewursst
    -Goethe


  •  

    LinkBacks (?)


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •