Greasemonkey - Display Number Of Clicks Since Last Refresh?
Jan 14, 2010
I've just started some JavaScript development, but have run into a bit of a problem with a Greasemonkey script I'm working on. This script is for personal use. I'm doing a variety of things on a page, including auto-refreshing it. I want to display the number of clicks (preferably just on links) since the last refresh.
// Right click on file $('.file').live('mousedown', function(event) { // If rightmouseclick (=3) if(event.which == 3) { $(this).bind("contextmenu", function(e) { e.preventDefault(); }); [Code]...
When I right click on a file and pick "openFile"from the context menu, the action only run once. But when I do this again, it runs twice. When I do this again, it run three times, and so on ... For some reason jQuery (or JavaScript) is counting the times I have clicked on the class '.file', and fires the action according to this number.
i have a dropdown list where a user can select, 'Yes','No', and 'Other'. What i need to have happen, is that if a user selects other, i need a textfield to appear so the user can enter a custom variable. does anyone have code for this?? Code:
I'm trying to set up a web page to display a video when a user clicks on a link. So far, it works fine in IE and Chrome, but it won't work in Firefox.[URL]
I m able to do pagination. But I face another challenge where I once click next,prev or page number,it will refresh the accordion. let say i got 3 headers of accordion.namely A,B,C. After clicking any function in either B or C. It will auto refresh to header A. is it due to I destroy my accordion each time I called?
I am trying to update my PHP CART without having the page refreshed! Here is a part of my code... I will just use the UPDATE_QUANTITY part (there are ADD & Remove)My Form that holds the quantity:
I'm building a video site for the radio station I work for and need to display a specified video on each refresh. The video will be an embed from youtube and sit in a <div> of it's own.
Unfortunately due to the servers I work on I can't user server side programming.
how it looks (it might help) the sites on test at [URL]
I am having trouble with a script that displays the url of an iframe. On this page, I have a single iframe and want to display the url of the iframe in a div. It works upon initial loading, but the url does not change when a link within the iframe is clicked and a new iframe page loads within the frame. My users need the ability to determine and directly link/view the iframe url.
Here is the script <iframe id="mainFrame" name="mainFrame" class="inner-center" frameborder="0" scrolling="auto" width="100%" height="400" src="whats_new.htm"></iframe>
[Code]....
what to research and implement. Can you reload the content in the div? do I want to look at cross-frame scripting?
i wish to count number of characters in textarea box during typing in and display it somewhere in html page. so the number will increase during writing. is it possible to do it by javascript?
I have a calculated value that is negative, which I need to display in a javacript prompt as positive. In ColdFusion, there is a function called ABS(), which gives you the absolute value of the number in question, so ABS(-5) = 5. Is there something similar in javascript? If no, how would I display a negative number without it's negative sign? Again, this is only for display purposes withing an alert.
Can anyone tell me: 1) why my string appears twice; 2) how to make it appear just once?
I'm trying to insert code at the top of every viewed page. Obviously, document.body appends the string to the closing body tag which is not what I want. What could I use to insert my code as the first childnode under 'body'?
I'm trying to write a script (my first) that loops through some table rows and gets some data from another page using gm_xmlhttprequests. It works if I keep the loop to one, but if I try and loop through all the rows, and therefore have say 10-20 gm_xmlhttprequests, the script just seems to fail. But if I put an alert inside each gm_xmlhttprequest, and wait a bit before dismissing the alert, the gm_xmlhttprequest will succeed and the data gets updated as planned. It seems as if the gm_xmlhttprequests don't block, or the script keeps executing without waiting for the requests to finish. I don't have any listeners on the script, I just want it all to load when the page loads. Also, I looked at the javascript console and it doesn't have any errors about the gm_xmlhttprequests.
I am trying to learn some javascript at the moment and thought a simple greasemonkey script might be a good way to start.What I want the script to do is to replace an existing url on a website with a different url from another location within the website.
E.G. replace "/mailbox.php?inbox" with "/account.php?action=mybookmarks"
There are a lot of examples of replacing existing urls with different ones on the web but they all use id's to locate and replace urls.
This script is for a site I visit often and since I dont own it I dont have the ability to add id tags to the appropriate a tags, this makes writing this script a lot more difficult.This is the code I have so far;
would like to know a tool that could give me a clue on where is the error in a greasemonkey script that i'm working on. I'm using notepad, what tool could "run" the script and tell me where is the error?
And this is what is SOMETIMES returned when I display Application('errormsg'), the rest of the time, it works:
An exception occurred in the script. Error name: Error. Error description: Path not found. Error number: -2146828212. Error message: Path not found
But I don't know which path is not found! (I'm using the filesystem object and importing data from a file into SQL.) Is there a way to display the line number of the error or more details? Or do I just have to try to catch the error by going through each bit of code?