JS conflict in blogger

Discussion in 'JavaScript' started by jainy25, Dec 8, 2009.

  1. #1
    Hi guys,

    I am having a serious problem. Since blogger blogs don't automatically implement emoticons in their blogs, I being an owner of a blogger blog myself, decided to use this script for implementing smileys in my blog. Now here is where the problem occurs MAINLY IN FIREFOX. I am also using infolinks on my blog.

    The thing is that once the smiley script loads on the blog, the infolinks stop showing the ad information and even if you click on them, nothing happens. In a way, this smiley script blocks infolinks on my blog. This is only happening in firefox. I tested my blog in IE, and there it is working perfectly fine.

    So guys, any suggestion on how I can fix this problem as people around the world mostly use FF.
     
    jainy25, Dec 8, 2009 IP
  2. shakemelikeapig

    shakemelikeapig Peon

    Messages:
    140
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi !! This problem even occurred with my blog once...
    You might not have given a closing tab after the script.
    Please check the script again and try giving the script for ads before the script for smilies.:)

    Hope your problem will be solved..
     
    shakemelikeapig, Dec 10, 2009 IP
  3. jainy25

    jainy25 Well-Known Member

    Messages:
    160
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    130
    #3
    closing tab? Well...everything is fixed for sure. I have put an ending </script> tag, well as the curly brackets are fine. If I try putting an extra bracket, it messes up my smiley script, and the smileys won't load. At that point of time, infolinks works fine.

    Putting the ads first or below the smiley script doesn't help.
     
    jainy25, Dec 10, 2009 IP
  4. hdewantara

    hdewantara Well-Known Member

    Messages:
    540
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #4
    Found that you loaded smiley by function below?
    addLoadEvent(function(){ addSmiley();});
    HTML:
    If my suspicion is right, this might be an event conflict type.

    Try loading it by something like
    addEventListener('load',addSmiley,false);
    HTML:
    ,
    but you should remove it later by
    removeEventListener('load',addSmiley,false);
    HTML:
    .

    BTW, got some errors on my FF loading your blog :D
     
    hdewantara, Dec 15, 2009 IP
  5. jainy25

    jainy25 Well-Known Member

    Messages:
    160
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    130
    #5
    You are right about the part that I have put addLoadEvent(function(){ addSmiley();}); in my script at the end.

    As you suggested, I added
    addEventListener('load',addSmiley,false);
    HTML:
    ,
    then the smileys worked fine but again the infolinks didn't. Now the confusion is where should I put
    removeEventListener('load',addSmiley,false);
    HTML:
    ? If I put it just after addeventlistener, the script doesn't work. So where should I add it?

    Btw, what errors are receiving while viewing the blog in FF?
     
    jainy25, Dec 16, 2009 IP
  6. hdewantara

    hdewantara Well-Known Member

    Messages:
    540
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #6
    1) Err.. almost there, and I have also mistyped it, sorry.
    What I meant exactly was to rewrite the HTML <body> tag into:
    <body onload="addEventListener('load',addSmiley,false);"
      onunload="removeEventListener('unload',addSmiley,false);">
    HTML:
    2)About the infolinks, how do you load it? I couldn't find it within your script.

    3) You could see errors/warnings by turning the TOOLS\ERROR CONSOLE menu of FF (I think all modern browsers have this kind of console nowadays).
    I couldn't paste all here...:(
    etc...
     
    Last edited: Dec 16, 2009
    hdewantara, Dec 16, 2009 IP