Jump to content

context menu not working


darkfreaks

Recommended Posts

ok so if anyone can tell me why my menu is not working on right click , please point it out to me.

 

Greasemonkey file:


   
// ==UserScript==
// @name           rightClick
// @namespace      vampirefreaks.com/possumboy
// @description    jquery on vf
// @include        http://vampirefreaks.com/*
// @include        http://*.vampirefreaks.com/* 
// ==/UserScript==


pHead = document.getElementsByTagName("head")[0];
pBody = document.getElementsByTagName("body")[0];

// embeds the jquery script into the vf Page
scr = document.createElement("script");
scr.setAttribute("type","text/javascript");
scr.setAttribute("src","http://www.kaboochie.com/jquery.js");
scrTex = document.createTextNode("");
scr.appendChild(scrTex);
pHead.appendChild(scr);
//creates a script element within the head of the vf page where the jquery can go.
Pscr = document.createElement("script");
Pscr.setAttribute("type","text/javascript");
Pscr.setAttribute("id","gm_jquery");
pHead.appendChild(Pscr);



// creates the rightClick menu and embeds it into the page.
menDiv = document.createElement("div");
menUl = document.createElement("ul");



menDiv.setAttribute("id","conMenu");
menDiv.setAttribute("class","contextMenu");
menDiv.setAttribute("style","background-color: #000000;");

menLi_1 = document.createElement("li");
menLi_1.setAttribute("id","inbox");
menLi_1_text = document.createTextNode("Inbox");

menLi_2 = document.createElement("li");
menLi_2.setAttribute("id","comments");
menLi_2_text = document.createTextNode("Comments");

menLi_3 = document.createElement("li");
menLi_3.setAttribute("id","pcs");
menLi_3_text = document.createTextNode("Pic Comments");

menLi_4 = document.createElement("li");
menLi_4.setAttribute("id","main_link");
menLi_4_text = document.createTextNode("Main");

menLi_5 = document.createElement("li");
menLi_5.setAttribute("id","editPro");
menLi_5_text = document.createTextNode("Edit Profile");

menLi_6 = document.createElement("li");
menLi_6.setAttribute("id","editPic");
menLi_6_text = document.createTextNode("Edit Pictures");

menLi_7 = document.createElement("li");
menLi_7.setAttribute("id","myCults");
menLi_7_text = document.createTextNode("My Cults");

menLi_8 = document.createElement("li");
menLi_8.setAttribute("id","mBoard");
menLi_8_text = document.createTextNode("Messageboard");

menLi_9 = document.createElement("li");
menLi_9.setAttribute("id", "cRoom");
menLi_9_text = document.createTextNode("Chatroom");

menLi_1.appendChild(menLi_1_text);
menLi_2.appendChild(menLi_2_text);
menLi_3.appendChild(menLi_3_text);
menLi_4.appendChild(menLi_4_text);
menLi_5.appendChild(menLi_5_text);
menLi_6.appendChild(menLi_6_text);
menLi_7.appendChild(menLi_7_text);
menLi_8.appendChild(menLi_8_text);
menLi_9.appendChild(menLi_9_text);

menUl.appendChild(menLi_4);
menUl.appendChild(menLi_1);
menUl.appendChild(menLi_2);
menUl.appendChild(menLi_3);
menUl.appendChild(menLi_5);
menUl.appendChild(menLi_6);
menUl.appendChild(menLi_7);
menUl.appendChild(menLi_;
menUl.appendChild(menLi_9);

menDiv.appendChild(menUl);

pBody.appendChild(menDiv);


// retrieves code for the jquery and adds script to inside the tag - creates functions for each menu option.
jq = document.getElementById("gm_jquery");

GM_xmlhttpRequest({
    method: 'GET',
    url: 'http://www.kaboochie.com/jquery.htm',
    headers: {
        'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
        'Accept': 'text/xml',
    },

    onload: function(responseDetails) {
response = responseDetails.responseText;
jq.innerHTML=response;
}
});

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.