Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

script not stops

 
deep raj
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<HTML>
<HEAD>
<SCRIPT type="text/javascript">
function anchor_test() {
document.write("FGDF");
}
</SCRIPT>
</HEAD>
<BODY>
<A href="javascript:anchor_test()">Test</a>

</BODY>
</HTML>


in this script remains continous
i am not understand what is the problem?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.

I don't understand either, because the HTML/JavaScript you posted here not only isn't continuous, absolutely nothing will happen, because you don't call the function. Can't you see your post after you make it and notice it didn't work?!
 
deep raj
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now tell me the mistake in this code
you can run this code at your pc to find out problem
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I meant to put the code tags around the actual code, not just at a random location in your message.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What makes you think it's running infinitely?
 
deep raj
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i will remember this
but now please tell me what is the problem in this code while running scripts can't stops
 
deep raj
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you check in this code by run it
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
amrita singhal wrote:can you check in this code by run it

I did. What makes you think it's running infinitely?
 
deep raj
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is running at your pc?
but in my one whenever i clicked on test it shows the "fgdf"
but loading is continuous.
i don't undersdtand why?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because different browsers deal with inappropriate JavaScript in different ways--just because the browser (FF will show a loading spinner, Chrome does nothing) is showing you something doesn't necessarily mean any of your code is executing infinitely.
 
deep raj
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i stop this loading spinner
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using document.write after the file is loaded will (generally) have undefined behavior. So probably not.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic