Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Location
    Isle of Skye, Scotland
    Posts
    92
    Plugin Contributions
    0

    Default Javascript within blank_sidebox mod

    I have some Javascript code for 'click to bookmark'. I know there is a bookmark sidebox mod which I have tried but I want to see if I can get this code formatted right as it works across all browsers with just a click.

    I can get the code to work fine in tpl_header.php, but my client wants it on the right hand column of the page. I have been trying to place the Javascript within the blank_sidebox but it just makes everything else dissappear. Could anyone help me know how to incorporate this code in the side column?

    The site is www.plantperfection.co.uk (login as skyegospel################## with password Test1 to view)
    The code is as follows:

    <script language="JavaScript1.2" type="text/javascript">
    function CreateBookmarkLink() {
    title="www.PlantPerfection.co.uk";
    url="http://www.plantperfection.co.uk";
    if (window.sidebar) { // Mozilla Firefox Bookmark
    window.sidebar.addPanel(title, url,"");
    } else if( window.external ) { // IE Favorite
    window.external.AddFavorite( url, title); }
    else if(window.opera && window.print) { // Opera Hotlist
    return true; }
    }

    if (window.external) {
    document.write('<a href="javascript:CreateBookmarkLink()");"> Bookmark this site</a>');
    } else if (window.sidebar) {
    document.write('<a href="javascript:CreateBookmarkLink()");"> Bookmark this site</a>');
    } else if (window.opera && window.print) {
    document.write('<a href="javascript:CreateBookmarkLink()");"> Bookmark this site</a>');
    }
    </script>

    Many thanks in advance to anyone who can help with this,

    Stuart

  2. #2
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Javascript within blank_sidebox mod

    2nd sidebox down. left side at
    http://www.dezinashop.com/demo/
    Tested with IE, Firefox..does not work
    with Google Chrome..

  3. #3
    Join Date
    Aug 2008
    Location
    Isle of Skye, Scotland
    Posts
    92
    Plugin Contributions
    0

    Default Re: Javascript within blank_sidebox mod

    Misty, looks like the same code used there but I take it I have incorporated it into the sidebox wrong? I have just pasted the whole code there and it makes the whole sidebox go blank each time. The guy who sent me the code had only tried it in his header so I am relaly glad to see a working example of it in a sidebar!

    Stuart

  4. #4
    Join Date
    Dec 2006
    Location
    Athens - Greece
    Posts
    71
    Plugin Contributions
    0

    Default Re: Javascript within blank_sidebox mod

    Stuart, have you tried to place the code in one line?

    You might find it strange, but in the past, I had the same problem, when I wanted a blank_sidebox to show a swf movie.

    When I place the code in one line, everything was OK.

    Hope that it helps you..

    George

  5. #5
    Join Date
    Aug 2008
    Location
    Isle of Skye, Scotland
    Posts
    92
    Plugin Contributions
    0

    Default Re: Javascript within blank_sidebox mod

    Thanks Pelasgos. No joy, but I have now found a new home for it in the header alongside the login text so am quite happy with it there.

    Stuart

  6. #6
    Join Date
    Dec 2006
    Location
    Athens - Greece
    Posts
    71
    Plugin Contributions
    0

    Default Re: Javascript within blank_sidebox mod

    I'm glad you made it!

 

 

Similar Threads

  1. Replies: 8
    Last Post: 26 Feb 2016, 12:41 AM
  2. Replies: 3
    Last Post: 6 Feb 2010, 11:27 AM
  3. PHP and Javascript embedded within
    By Donn in forum General Questions
    Replies: 3
    Last Post: 6 Feb 2009, 01:20 AM
  4. blank_sidebox mod define, how to put in HTML??
    By tlyczko in forum Addon Sideboxes
    Replies: 5
    Last Post: 28 Oct 2008, 06:56 PM
  5. Javascript in blank_sidebox? How to.........????
    By tolefairy in forum Addon Sideboxes
    Replies: 1
    Last Post: 14 Apr 2007, 01:04 AM

Posting Permissions

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