Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Nov 2003
    Location
    Vancouver Island Canada
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Small bookmarklets that make testing easier.

    These are a couple little bookmarklets that make testing your pages easier.
    This is for adjusting resolution.

    <script>
    javascript:external.AddFavorite('javascript:void(m=window.open("","m","height=30,width=150"));m.focu s();m.document.write(\'<form><select onchange="opener.eval(this[this.selectedIndex].value)"><option value=""><option value="self.resizeTo(640,480)">640x480<option value="self.resizeTo(800,600)">800x600<option value="self.resizeTo(1024,768)">1024x768</select></form>\')','Resize')
    </script>

    This is for running selected code. You select the code then open the bookmark. (I used it testing this post.)

    <script>
    javascript:window.external.AddFavorite('javascript:void(window.open("javascript:document.write(opene r.document.selection.createRange().text);document.close()"))','Run Code Selected')
    </script>

    Turn borders on to see table layout.

    <script>
    javascript:window.external.AddFavorite('javascript:void(t=document.getElementsByTagName("table"));fo r(i=0;i<t.length;i++){void(t[i].border="1")}','Borders On')
    </script>


    I use them regularly hope they're usefull to you.

  • #2
    Regular Coder
    Join Date
    Nov 2003
    Location
    Vancouver Island Canada
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    messed up code

    The code I've posted, when copied and pasted gives errors when run as an htm file. It happened when I copied and pasted it here. To fix it you have to take the spaces out between "java " and "script". Don't know why it has the added spaces but it does. So the procedure is to copy and paste the code into notepad , remove the spaces, save the fie as an htm document and then open it. It will give you a warning but don't worry it's safe code then will create a bookmark that will do as expected.

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,965
    Thanks
    0
    Thanked 236 Times in 233 Posts

    about the space in java and script


  • #4
    Regular Coder
    Join Date
    Nov 2003
    Location
    Vancouver Island Canada
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OOPs sorry

    I should've read that forum first, sorry :o . It won't happen again

  • #5
    Senior Coder
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    1,063
    Thanks
    2
    Thanked 0 Times in 0 Posts
    How do you use this?
    Shawn

  • #6
    Regular Coder
    Join Date
    Nov 2003
    Location
    Vancouver Island Canada
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to use these

    Copy the code into notepad save as a HTML file then open it. After a warning it will ask you if you want to save it as a bookmark , say yes then when you are viewing a webpage that you want to resize, or see borders open the favorites menu and choose the appropriate book mark it will open a little window that will give you a choice of screen resolution or put borders on tables on the page being veiwed. If you want to run selected code you first select the code then choose the run code bookmark. I use them all the time to test pages I'm writing or to see how tables have been set up or to run code on a webpage for testing purposes.

  • #7
    Regular Coder
    Join Date
    Nov 2003
    Location
    Vancouver Island Canada
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to use these

    Copy the code into notepad save as a HTML file then open it. After a warning it will ask you if you want to save it as a bookmark , say yes then when you are viewing a webpage that you want to resize, or see borders open the favorites menu and choose the appropriate book mark it will open a little window that will give you a choice of screen resolution or put borders on tables on the page being veiwed. If you want to run selected code you first select the code then choose the run code bookmark. I use them all the time to test pages I'm writing or to see how tables have been set up or to run code on a webpage for testing purposes.

  • #8
    Regular Coder
    Join Date
    Nov 2003
    Location
    Vancouver Island Canada
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    back button

    Sorry for the double post . I hit the back button. That too won't happen again I'm learning!!!!

  • #9
    Senior Coder
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    1,063
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks.

    For the double post, I think you can erase one of them. Use the edit button.
    Shawn


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •