var rate = 3.3;
<!-- httpResponseText -->
<div onMouseover="myfunc();" onclick="getNewText to replacealllthis();"> this is output by ajax http request</div>
alert(rate); // rate was initially 3.3
//after onclick event the value of rate has changed to say 4.4
// but onMouseover event will still alert 3.3 so how to update this rate var
// 4.4 ??
simple solution is to create output text as
<div onMouseover="myfunc(4.4);" onclick="getNewText to replacealllthis();"> this is output by ajax http request</div>
->> and myfunc alert the val
However I don't want to pass param to myfunc() but use single var rate to do this event.
1. Can I ie is there a way to receive a return value from php script as well as the responseText?
2. I tried outputting
var rate = 4.4;
</script> ... and rest of response text
but all the response text willl simply be printed in the output div and the updated var rate is not run . so is there a way to make this assignment of new value to rate run?
Well Alien if you could be little more specific on how to use eval , would be much more help.
after making http ajax request this value might have been changed, lets just say I need to change this var to 20,
so if i print the var again like var rating = 20 from output handler function, how do I run this script?