School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,489 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,821 people online right now. Registration is fast and FREE... Join Now!




Greasemonkey script issues

 

Greasemonkey script issues

predator101

18 Jun, 2009 - 05:42 PM
Post #1

New D.I.C Head
*

Joined: 6 Mar, 2009
Posts: 7

I'm trying to modify Facebook Purity (http://bit.ly/fbpure) to display "msgs" or "msg" based on the number of applications blocked.

It shouldn't be that hard, but it's not working.

CODE
if(insertpoint && insertpoint.firstChild) {
      
        var fbpurityinfo=document.createElement('div');
        fbpurityinfo.setAttribute('class','UIOneOff_Container');
        fbpurityinfo.style.marginBottom='12px';
        
        var label;
        if (crappyappmsgcounter==1){
        label="msg";
        }
        else{
        label="msgs";
        }
        fbpurityinfo.innerHTML = '<a href="http://bit.ly/fbpure">FB Purity</a> blocked: <span id="fbpblockcount">0</span> app ' + label + ' [ <a id="fbpshowblockedlink" href="java script:;">Show</a> ]';
        insertpoint.insertBefore(fbpurityinfo, insertpoint.firstChild);
        document.getElementById('fbpshowblockedlink').addEventListener("click", fbpshowblocked, false);
        fpbblockcountspan=document.getElementById('fbpblockcount');
      }


Am I doing something wrong or should it work?

This post has been edited by predator101: 18 Jun, 2009 - 05:50 PM

User is offlineProfile CardPM
+Quote Post


William_Wilson

RE: Greasemonkey Script Issues

18 Jun, 2009 - 05:55 PM
Post #2

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,631



Thanked: 88 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
where do you set insertpoint? Does this have a value before you use it?

for that matter, is crappyappmsgcounter set correctly anywhere?
User is offlineProfile CardPM
+Quote Post

predator101

RE: Greasemonkey Script Issues

18 Jun, 2009 - 06:05 PM
Post #3

New D.I.C Head
*

Joined: 6 Mar, 2009
Posts: 7

I only included the part I was working on. I can post the rest, if you'd like.

Insertpoint is set, and so is crappyappmsgcounter.

This post has been edited by predator101: 18 Jun, 2009 - 06:06 PM
User is offlineProfile CardPM
+Quote Post

predator101

RE: Greasemonkey Script Issues

21 Jun, 2009 - 09:21 PM
Post #4

New D.I.C Head
*

Joined: 6 Mar, 2009
Posts: 7

Bump
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 04:16AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month