Dear all
I have given a code snippet please help me out to sort out this issue

<code>
<script type="text/javascript">
function interval_setting(){
var clear = 0;
clear =setInterval("xmlhttpPost11('index.cgi','tracker_shower','Latest_frame','Tracker_loader',clear,'','','')",20000);}
</script>
</code>

Please reply cant i pass variable clear like this ?
Cause in xmlhttpPost if i give single quote to that variable it gives 'clear' not 0;

Recommended Answers

All 4 Replies

cant i pass variable clear

To be passed in this way, the variable must be global (declared without var)

function interval_setting() {
  _clear = 0;
  _clear = setInterval("xmlhttpPost11('index.cgi','tracker_shower','Latest_frame','Tracker_loader',_clear,'','','')", 20000);
}

Lemme try it out thanks for reply buddy ...

I have alerted value of _clear ... it is giving me 2 why so ?

.....

Er, because that value was returned by your setInterval()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.