0

Hi everyone. I am having some trouble with my PHP and jQuery.

<script>
function solveError(id) 
{
        $('#loading').html('<img src="resources/images/loading.gif" width="16" height="16" />').load('solve_error.php?id=' + id + '');
}
</script>

And here is the PHP

<a href="#" title="Solved" onclick="solveError('<?php echo $error['error_id']; ?>');"><img src="resources/images/icons/tick_circle.png" alt="Solved" /></a>

When I get rid of the id variable from the solveError() function it works but when I have the id variable it stops working. Please help.

Thanks in advance,
Cameron

2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by doctorphp
0

What is in solve_error.php? Does it work if you put something like exit('hello'); on the top of that page? jQuery is very good at hiding errors.

0

At the moment is just echoes "Solved" but I will add some PHP and MySQL to it once I can sort this problem out.

0

Well, it's just a guess, something I would try, but anyway, something like this:

function solveError(id) 
{
        $('#loading').html('<img src="resources/images/loading.gif" width="16" height="16" />');
        $.ajax('solve_error.php', {data:{id:id}, complete:function(o,s){$('#loading').html(o.responseXML);}});
}

Edited by twiss: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.