yolop Posted November 15, 2008 Share Posted November 15, 2008 i tried to do this <a href='1.php?photo_id= <script type="text/javascript"> i=0; document.write(i);i=i+1;</script>'> sss</a> but the likn show like that 1.php?photo_id=%3Cscript%20type=%22text/javascript%22%3Ei=0;document.write(i);i=i+1;%3C/script%3E not good i need the link will show like that1.php?photo_id=0 help!!!! thatk Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted November 15, 2008 Share Posted November 15, 2008 are you maybe trying to create a loop with links <script type="text/javascript"> var numlinks=10; for(var i=0;i<numlinks;i++){ document.write('<a href="1.php?photo_id='+i+'">link</a><br />'); } </script> sss</a> Quote Link to comment Share on other sites More sharing options...
BoltZ Posted November 16, 2008 Share Posted November 16, 2008 declare this outside of the link. Also you forgot to use var. <script type="text/javascript"> var i=0; var url=document.write(i);i=i+1; </script> <a href='1.php?photo_id=url'> sss</a> Untested but I think it should work unless I made a stupid mistake. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.