Go Back   CodingForums.com > :: Client side development > JavaScript programming > Post a JavaScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-15-2004, 04:03 PM   PM User | #1
glenmac
Regular Coder

 
Join Date: Nov 2003
Location: Vancouver Island Canada
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
glenmac is an unknown quantity at this point
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
glenmac is offline   Reply With Quote
Old 02-17-2004, 04:28 PM   PM User | #2
glenmac
Regular Coder

 
Join Date: Nov 2003
Location: Vancouver Island Canada
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
glenmac is an unknown quantity at this point
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
glenmac is offline   Reply With Quote
Old 02-18-2004, 05:01 AM   PM User | #3
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
about the space in java and script

http://www.codingforums.com/showthre...090#post117971
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 02-18-2004, 06:10 AM   PM User | #4
glenmac
Regular Coder

 
Join Date: Nov 2003
Location: Vancouver Island Canada
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
glenmac is an unknown quantity at this point
OOPs sorry

I should've read that forum first, sorry :o . It won't happen again
__________________
lantzvillecomputers.com
glenmac is offline   Reply With Quote
Old 02-19-2004, 11:51 PM   PM User | #5
shlagish
Senior Coder

 
Join Date: Apr 2003
Location: Canada
Posts: 1,063
Thanks: 2
Thanked 0 Times in 0 Posts
shlagish is an unknown quantity at this point
How do you use this?
__________________
Shawn
shlagish is offline   Reply With Quote
Old 02-20-2004, 05:24 PM   PM User | #6
glenmac
Regular Coder

 
Join Date: Nov 2003
Location: Vancouver Island Canada
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
glenmac is an unknown quantity at this point
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
glenmac is offline   Reply With Quote
Old 02-20-2004, 05:31 PM   PM User | #7
glenmac
Regular Coder

 
Join Date: Nov 2003
Location: Vancouver Island Canada
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
glenmac is an unknown quantity at this point
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
glenmac is offline   Reply With Quote
Old 02-20-2004, 05:33 PM   PM User | #8
glenmac
Regular Coder

 
Join Date: Nov 2003
Location: Vancouver Island Canada
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
glenmac is an unknown quantity at this point
back button

Sorry for the double post . I hit the back button. That too won't happen again I'm learning!!!!
__________________
lantzvillecomputers.com
glenmac is offline   Reply With Quote
Old 02-21-2004, 09:35 PM   PM User | #9
shlagish
Senior Coder

 
Join Date: Apr 2003
Location: Canada
Posts: 1,063
Thanks: 2
Thanked 0 Times in 0 Posts
shlagish is an unknown quantity at this point
Thanks.

For the double post, I think you can erase one of them. Use the edit button.
__________________
Shawn
shlagish is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:56 AM.


Advertisement
Log in to turn off these ads.