prototypejs - JavaScript functions are not working in ajax tabs -
in page have ajax tabs , every tab consists of javascript functions. want load each javascript function when tabs clicked. functions not working in tabs. how can solve this?
my codes follows:
php:
echo "<script type='text/javascript'>"; echo "function check(){"; echo "alert('hello');"; echo "}"; echo "</script>"; echo "<div><a href='javascript:check();'>check</a></div>";
ajax:
new ajax.request( test.php, { method:'post', onsuccess: function(data){ var tmp=data.responsetext; $$('.tolga').invoke('insert',tmp); } });
html:
<div class="tolga"> </div>
Comments
Post a Comment