...

View Full Version : javascript error



ricolding
07-10-2012, 12:35 AM
opera message
for the file allsitejava.js

Syntax error at line 1 while loading: expected expression, got '<'
<HTML><HEAD><TITLE>E


and that is the content of the file


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);
cache: false;
}

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

$.ajaxSetup ({
cache: false
});

$(document).ready(function(){
$('#add_game_comment').submit(function() {
var gameid = $("#add_game_comment").attr("rel");
var comment=$('#add_game_comment textarea[name=comment]');
var comment= encodeURIComponent(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 ??

DrDOS
07-10-2012, 04:20 AM
Try escaping the < on the second line with a backslash \< .

xelawho
07-10-2012, 04:30 AM
if allsitejava.js is an external javascript file it should not have any html tags in it

ricolding
07-10-2012, 04:50 AM
Try escaping the < on the second line with a backslash \< .

still not working

Philip M
07-10-2012, 07:33 AM
Is this error only throwing in Opera? What about IE/FF/Chrome?

ricolding
07-11-2012, 01:33 PM
Is this error only throwing in Opera? What about IE/FF/Chrome?

The Same



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum