javascript - Function not working in Safari -
the function below works in firefox , internet explorer not work in safari. in safari, when click nothing happens.
how can fix function work in safari?
i've checked javascript enabled (tested in 3 different machines already).
thanks ton
<script> function win() { $("#main").remove(); $("#content_target").html('<div style="z-index:2;background:url(img/frame_main.png) no-repeat;text-align:left;width:726px;height:491px;"><div id="target" style="padding:5% 5%;float:left"></div> </div>'); $("#target").load("myphp.php", {variable1: "myvariable", variable2: 12}, function(){ $("#my_div").css('background', 'url("img/img_acti.png") no-repeat'); }); } </script> <div onclick="javascript:win();" ><a href="#">click me</a></div>
give try, putting function click trigger...
<script> function win() { $("#main").remove(); $("#content_target").html('<div style="z-index:2;background:url(img/frame_main.png) no-repeat;text-align:left;width:726px;height:491px;"><div id="target" style="padding:5% 5%;float:left"></div> </div>'); $("#target").load("myphp.php", {variable1: "myvariable", variable2: 12}, function(){ $("#my_div").css('background', 'url("img/img_acti.png") no-repeat'); }); } $("#clickme").click(function(){ win(); }); </script> <div id="clickme" ><a href="#">click me</a></div>
Comments
Post a Comment