Web Analytics Made Easy -
StatCounter Small bookmarklets that make testing easier. - CodingForum

Announcement

Collapse
No announcement yet.

Small bookmarklets that make testing easier.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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.
    lantzvillecomputers.com

  • #2
    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.
    lantzvillecomputers.com

    Comment


    • #3
      about the space in java and script

      http://www.codingforum.net/showthrea...090#post117971
      Glenn
      vBulletin Mods That Rock!

      Comment


      • #4
        OOPs sorry

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

        Comment


        • #5
          How do you use this?
          Shawn

          Comment


          • #6
            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.
            lantzvillecomputers.com

            Comment


            • #7
              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.
              lantzvillecomputers.com

              Comment


              • #8
                back button

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

                Comment


                • #9
                  Thanks.

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

                  Comment

                  Working...
                  X