| View previous topic :: View next topic |
| Author |
Message |
Precise
Joined: 30 Dec 2007 Posts: 18 Location: East Coast
|
Posted: Sat Jul 12, 2008 7:47 pm Post subject: Shortening Bookmarklets |
|
|
When trying to use a javascript bookmarklet with an llbbrowse browser object in a gui, you may need to use something like this:
| Code: |
javascript:function D(a,b){c=b.split('|');d=false;for(q=0;q<c.length;q++){if(c[q]==a)d=true;}return d;}function E(){f0=document.forms[0];f0['avname'].value='aaaaaaaaaaaaaaaf';f0['password'].value='pass';f0['checkpassword'].value='pass';f0['bmonth'].value='02';f0['bday'].value='06';f0['byear'].value='1986';f0['email'].value='preciseisme@domain';f0['optin_newsletters'].checked=true;f0['captentry'].value='seminary';for(i=0;i<f0['EULA'].length;i++){if(D(f0['EULA'][i].value,'on')){f0['EULA'][i].checked=true;}}}E()
|
But when you enter it, nothing happens. The bookmarklet works fine in Firefox, but won't work in IE. It could be that IE is not cutting off the end of the bookmarklet. IE can only handle so many characters in the url box.
| Code: |
javascript:function D(a,b){c=b.split('|');d=false;for(q=0;q<c.length;q++){if(c[q]==a)d=true;}return d;}function E(){f0=document.forms[0];f0['avname'].value='somename';for(i=0;i<f0['EULA'].length;i++){if(D(f0['EULA'][i].value,'on')){f0['EULA'][i].checked=true;}}}E()
|
Last edited by Precise on Tue Jul 15, 2008 8:11 am; edited 2 times in total |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Sun Jul 13, 2008 8:51 am Post subject: |
|
|
Does it work from the addressbar in Internet Explorer?
You should use the newer COM version if you would like to add an IE-Window to your GUI, the lbbrowse-version is obsolete.
HTH |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Jul 14, 2008 12:52 am Post subject: |
|
|
| Nope, it does not work in the IE Explorer bar. That would explain it. The problem though is that it is too long. Is there any way around this? |
|
| Back to top |
|
 |
Precise
Joined: 30 Dec 2007 Posts: 18 Location: East Coast
|
Posted: Tue Jul 15, 2008 8:03 am Post subject: Solved |
|
|
| By removing some of the fields and seperating the javascript into several smaller ones I was able to get these to work. I'm new to javascript so I had no idea what I was doing with it. |
|
| Back to top |
|
 |
BoBo² Guest
|
Posted: Tue Jul 15, 2008 9:00 am Post subject: |
|
|
| Quote: | | IE can only handle so many characters in the url box [address field]. | Your damn right. To be more specific, the number of characters the addressbar is able to handle depends on the IE release!
I would be interested too how to hand over complete (multiline) JavaScript functions that way, but I'm to stupid to find out how to make it work ...  |
|
| Back to top |
|
 |
|