SitePoint Sponsor |
|
User Tag List
Results 1 to 25 of 42
-
Jan 24, 2007, 16:04 #1
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Browser compatibilty for this js code please
Hi all,
As far as total browser compatibility and usability is concerned - is the js code in the website ok please ?
http://www.010805.com/favorites
Any help appreciated.
Regards.
Dez.
-
Jan 24, 2007, 20:34 #2
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
js err msg
Opera gives
JavaScript - http://www.010805.com/favorites/
Event thread: click
Error:
name: TypeError
message: Statement on line 7: Could not convert undefined or null to object
Backtrace:
Line 7 of linked script http://www.010805.com/favorites/bookmark.js
window.external.AddFavorite(this.href, this.title);
At unknown location
[statement source code not available]Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Jan 24, 2007, 23:28 #3
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Only Internet Explorer allows access to add to favorites from a link. All other browsers require that the person press CTRL-D or CTRL-T depending on the browser.
To get rid of the error in modern browsers you can change it to
Code:if (window.external && window.external.AddFavorite) window.external.AddFavorite(this.href, this.title);
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Jan 25, 2007, 02:18 #4
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Dez, I suggest you read this page.
You mean Windows browsers. Konqueror uses CTRL + B and many Mac browsers use Command/Cmd + D.We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Jan 25, 2007, 02:40 #5
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Many, many thanks for these comments and links - they are all useful and appreciated.
I'll do some more work on it and come back to you.
One thing, the add to favs on that page *does* work with my FF - didn't it work with your FF ?
Dez.
-
Jan 25, 2007, 04:08 #6
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, you script adds a bookmark in FF, but the bookmark opens in the sidebar instead of in a normal window/tab. Did you not read the page I linked to?
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Jan 25, 2007, 05:18 #7
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Aha, now I see - I had read the article very fully and implemented the code, but hadn't then tried to open the bookmark to see what had happened with it - now I understand the references to sidebar and side windows ;-)
Now that I understand the problem more fully, and have used the code from that link - could someone please help to get code right, as it still doesn't seem to work ?
http://www.010805.com/favorites/
It still seems to save it into the sidebar ?
Any help very much appreciated.
Dez.
-
Jan 25, 2007, 05:55 #8
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jan 25, 2007, 06:47 #9
- Join Date
- Dec 2006
- Location
- Prague
- Posts
- 210
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It is not bad idea to add page to sidebar, but I can imagine it just with special page made just for this reason. For example left menu from here http://www.sitepoint.com/forums/ If you combine sources above with this http://home.arcor.de/xbo/sidebar-cross-browser/ and this http://www.howtocreate.co.uk/tutoria...ateSidebar.php you can develop sidebar for all most often browsers.
-
Jan 25, 2007, 08:17 #10
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Many thanks for the input Mirek - really looking to avoid the side windows.
Dez.
-
Jan 25, 2007, 08:17 #11
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jan 26, 2007, 00:26 #12
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You have violated the terms of use for that script. The comment block says that it must be included with the script. Why should we continue to help you, especially when it seems that you don't understand a lot of what you should have read?
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Jan 26, 2007, 02:17 #13
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for the friendly reply Kravvitz - it's appreciated
I wasn't sure where to include that code, but I've now put it into the kravvitz.js file - if that's wrong, just let me know
I had read the article very fully and implemented the code, but hadn't then tried to open the bookmark to see what had happened with it - now I understand the references to sidebar and side windows ;-)
Now that I understand the problem more fully, and have used the code from that link - could someone please help to get code right, as it still doesn't seem to work ?
http://www.010805.com/favorites/
It still seems to save it into the sidebar ?
Any help very much appreciated.
Dez.
-
Jan 27, 2007, 06:32 #14
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Anyone ?
-
Jan 27, 2007, 18:45 #15
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
There is no cross browser solution for anything that involves using Javascript to update anything outside of the web page since with the exception of the functionality that IE contains that is intended for use on INTRAnets most browsers provide minimal access to anything not in the page itself. As this access (small as it is) is being progressively shown to sometimes be the cause of many of the security holes in the various browsers the newer browser versions are progressively moving toward providing no access whatever to anything outside of the web page or at least limiting it to reading info about the brower itself only.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Jan 27, 2007, 19:02 #16
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Jan 27, 2007, 20:36 #17
- Join Date
- Sep 2006
- Posts
- 731
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jan 29, 2007, 04:30 #18
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks to all who have posted helpful comments here - it's definitely helping me to understand more about this.
Kravvitz - it may have missed your perception, but I am new to this and am trying to learn - I'm sure we've all been at that juncture at some stage ! Does that ID go in the following code please ?
<body>
<ul class="test">
<li><a class="bookmark" href="http://www.010805.com/favorites/" title="caption">Favorites</a></li>
</ul>
</body>
</html>
Also, just to clarify - doing this exactly as you kindly suggest, would the add to favorites work both in FF and IE with just 2 clicks and without any use of side windows in FF ?
Any help much appreciated.
Dez.
-
Jan 29, 2007, 05:16 #19
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The unique ID should be applied to whichever element you want to be the parent of the link that the script creates.
It depends how you define "2 clicks". In Firefox you click then link, then you read the alert box and click "OK", and then press the keys it told you to press. Currently, only IE/Win and Opera 7+ provide the functionality you want.We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Jan 29, 2007, 06:07 #20
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jan 29, 2007, 06:11 #21
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Many thanks Kravvitz - the help is appreciated.
Can anyone mention precisely what part of the code below that I would need to change at all please ?
<ul class="test">
<li><a class="bookmark" href="http://www.010805.com/favorites/" title="caption">Favorites</a></li>
</ul>
Any help is always appreciated.
Dez.
-
Jan 29, 2007, 11:38 #22
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
js errors
The page that Kravvitz linked to doesn't throw any javascript errors in Opera. Neither does your current page at http://www.010805.com/favorites/
Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Jan 29, 2007, 13:44 #23
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Many thanks Mittineague - I was a bit confused on that - thanks for clearing it up for me
Dez.
-
Jan 29, 2007, 23:40 #24
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Why would it have errors?
Code:<ul class="test"> <li><a class="bookmark" href="http://www.010805.com/favorites/" title="caption">Favorites</a></li> <li id="addBookmarkContainer"></li> </ul>
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Jan 31, 2007, 08:42 #25
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Relax Kravvitz, no-one said there were errors
Many, many thanks for the code, and for helping me to understand this whole thing ! The helps been appreciated.
Do you know if it's totally compat with all browsers, incl ie7 please ?
All the best.
Dez.
Bookmarks