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 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Smile javascript error

    opera message
    for the file allsitejava.js
    PHP Code:
    Syntax error at line 1 while loadingexpected expressiongot '<'
    <HTML><HEAD><TITLE>
    and that is the content of the file

    PHP Code:
    function goVoting(id,rater){
    $(
    ".rating_rate").html("<img src='/images/ajaxloader.gif' style='width:27px;height:27px'>");
    $(
    '.rating_bit li a').removeClass('active')
    var 
    active_smile='.smile_'+rater;
    $(
    active_smile).addClass("active");
    $.
    ajax({
    type:"POST",
    url:"/allsiteajax.php",
    data"grab=rating&gameid="+id+"&rating="+rater,
    success:function(html){
    $(
    ".rating_rate").html(html);
    }});
    }

    function 
    loadAchievements(g_id){
    $(
    '#medals_block').load('/allsiteajax.php?grab=achments&gameid='+g_id);
    cachefalse;
    }

    function 
    loadScores(board_id){
    $(
    '#scores_block').load('/allsiteajax.php?grab=ldscores&boardid='+board_id);
    cachefalse;
    }

    $.
    ajaxSetup ({
        
    cachefalse
    });

    $(
    document).ready(function(){
    $(
    '#add_game_comment').submit(function() {
    var 
    gameid = $("#add_game_comment").attr("rel"); 
    var 
    comment=$('#add_game_comment textarea[name=comment]');
    var 
    commentencodeURIComponent(comment.val());
    var 
    comlen='';var comlen=comment.length;
    if(
    comlen<8){alert('Please enter 8 or more characters!');return false;}
    $(
    "#addcomment_box").html("<img src='/images/ajaxloader.gif' />");
    $.
    ajax({
    type:"POST",
    url:"/allsiteajax.php",
    data:"grab=comments&gameid="+gameid+"&comment="+comment,
    success:function(html){$("#addcomment_box").html(html);$('#nocommentyet').hide();}});
      return 
    false;
    });

    $(
    '#installscript').click(function() {
    $.
    ajax({
    type:"POST",
    url:"/allsiteajax.php",
    data:"grab=installdb",
    success:function(html){$("#installresults").html(html);}});
      return 
    false;
    });
    }); 
    what is the problem ??

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,205
    Thanks
    15
    Thanked 253 Times in 253 Posts
    Try escaping the < on the second line with a backslash \< .

  • #3
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,983
    Thanks
    56
    Thanked 557 Times in 554 Posts
    if allsitejava.js is an external javascript file it should not have any html tags in it

  • #4
    New Coder
    Join Date
    Jul 2012
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by DrDOS View Post
    Try escaping the < on the second line with a backslash \< .
    still not working

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,150
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    Is this error only throwing in Opera? What about IE/FF/Chrome?

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #6
    New Coder
    Join Date
    Jul 2012
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    Is this error only throwing in Opera? What about IE/FF/Chrome?
    The Same


  •  

    Posting Permissions

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