How to javascript at the address bar of an webpage page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnagJohari
    New Member
    • May 2010
    • 96

    How to javascript at the address bar of an webpage page

    Can you tell me how the java script works when i write the script at the address bar of any web page. How it effect the execution of that perticular web page at which i write the script at the address bar ?
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    could you explain a bit more what you mean?

    when you type:
    Code:
    javascript:alert('foo');
    it just shows an alert ... nothing more ... and doesn't affect the page at all ... when you type:
    Code:
    javascript:document.getElementsByTagName('body')[0].style.display='none';
    then the body will be hidden and so it affects the page. so what you type and want to affect ... will be affected.

    kind regards

    Comment

    • AnagJohari
      New Member
      • May 2010
      • 96

      #3
      Originally posted by gits
      could you explain a bit more what you mean?

      when you type:
      Code:
      javascript:alert('foo');
      it just shows an alert ... nothing more ... and doesn't affect the page at all ... when you type:
      Code:
      javascript:document.getElementsByTagName('body')[0].style.display='none';
      then the body will be hidden and so it affects the page. so what you type and want to affect ... will be affected.

      kind regards
      if i write this script how its work.......
      Code:
      javascript:alert("Wait for few seconds for pic`s to load......");
      nb= document.all[0].innerHTML.match(/[0-9]*.jpg\)/g);nb=parseInt(nb);
      document.body.innerHTML="<center><span style="'font-size:100'"><b>anag script<br /></b>SCRIPT BYAnag Johari</a></span>";
      for(i=1;i<=100;i++){document.body.innerHTML+='<img src="http://img3.orkut.com/images/milieu/'+i+'/0/'+nb+'.jpg" /><br /><br /><br /><br />';};void(0)
      what it impact on the webpage .
      i type this at the address bar of an page.
      Thank you

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        basically it shows some images on a loaded page ... but only for the moment ... it will not affect the page at all (at least not permanently) ... just its current (local) representation ...

        what do you expect that it should do?

        Comment

        Working...