|
Did anyone else's greasemonkey's scripts stop working with Firefox 4? I'm not exactly what was broken by the change, but one of my scripts isn't working now.
|
# ? Mar 23, 2011 17:39 |
|
|
# ? May 15, 2024 09:44 |
|
epswing posted:Use parseInt! It's better to check for field length and/or use a regex with zip codes because using parseInt could lead to unintended consequenses for codes that start with zero. http://www.w3schools.com/jsref/jsref_parseInt.asp so instead, something like: code:
geeves fucked around with this message at 20:32 on Mar 23, 2011 |
# ? Mar 23, 2011 19:29 |
|
geeves posted:Careful with parseInt on zipcodes! There is no need to check length or use two regex: code:
|
# ? Mar 23, 2011 19:47 |
|
Great, thank you everyone!
|
# ? Mar 23, 2011 21:17 |
|
I'm not sure if this is a Firefox 4.0 or a Greasemonkey/Javascript issue but being too incompetent to find vaguely relevant threads other than this I figured I'll give you a try: A while ago in the old Greasemonkey thread that used to be somewhere I grabbed someone's script that's meant to open all the bookmarked threads you have with new posts from your control panel which worked perfectly, however today when I installed Firefox 4.0 it broke and I'm not sure why. I'm assuming the structure of the SA control panel page hasn't changed at all so what might have caused this to die all of a sudden? The button still appears but when clicked only opens the first thread with new posts instead of all. code:
|
# ? Mar 24, 2011 08:02 |
|
Not sure if this is exactly the same, but did you see this post: http://forums.somethingawful.com/showthread.php?threadid=3070034&userid=0&perpage=40&pagenumber=21#post386911133
|
# ? Mar 24, 2011 10:50 |
|
I did not see that post, and that does exactly the same thing as the one I had, but currently works! And has a text link instead of a slightly fancier button, but who cares about that. Don't care what was wrong with the one in my post anymore as this one works just as good. :P
|
# ? Mar 24, 2011 11:59 |
|
I'm really stumped on this one. I'm using the superfish nav bar, but instead of hiding the subnav on the mouse out I want it to stay displayed. The subsub nav can stay the same. Is there a quick fix? I've tried from my very little knowledge deleting different functions and nothing seems to help. Google has failed me as well. Example: http://sjenningsdesign.com/theacademy/navtest.html Got the code here: http://users.tpg.com.au/j_birch/plugins/superfish/ code:
cheese eats mouse fucked around with this message at 21:26 on Mar 24, 2011 |
# ? Mar 24, 2011 21:22 |
|
I'm not great at CSS, but I think that's what's doing it and not the JS - especially since when I open your example page in FF, I just get two JavaScript errors that indicate the plugin code isn't running:code:
Munkeymon fucked around with this message at 23:10 on Mar 24, 2011 |
# ? Mar 24, 2011 23:08 |
|
Munkeymon posted:I'm not great at CSS, but I think that's what's doing it and not the JS - especially since when I open your example page in FF, I just get two JavaScript errors that indicate the plugin code isn't running: Fixed the plugins. Still works the same, but I'll play with the CSS more.
|
# ? Mar 24, 2011 23:49 |
|
Wrong thread. def snow leppard fucked around with this message at 03:44 on Mar 25, 2011 |
# ? Mar 25, 2011 01:28 |
|
Clank posted:When should SwingUtilities.invokeLater ( Runnable ) be used? It should be used in the Java questions thread. I get confused when they are right next to each other in the thread list too.
|
# ? Mar 25, 2011 03:21 |
|
Lumpy posted:It should be used in the Java questions thread. I get confused when they are right next to each other in the thread list too. damnit, sorry.
|
# ? Mar 25, 2011 03:44 |
|
cheese eats mouse posted:Fixed the plugins. Still works the same, but I'll play with the CSS more. OK so even removing any instances of :hover in the CSS just removes the color styling. I'm hoping it's not in the JS code. cheese eats mouse fucked around with this message at 17:06 on Mar 25, 2011 |
# ? Mar 25, 2011 17:00 |
|
Lumpy posted:There is no need to check length or use two regex: You can further condense that regexp to /^\d{5}(-\d{4})?$/ .
|
# ? Mar 26, 2011 02:26 |
|
I'm trying to learn javacsript by studying code and I'd like to know what the following line does:code:
|
# ? Mar 26, 2011 19:03 |
|
Boz0r posted:I'm trying to learn javacsript by studying code and I'd like to know what the following line does: It's a ternary conditional.
|
# ? Mar 26, 2011 19:08 |
|
I am trying to change text in one cell of a table based on a selection of a drop down. The data is pulled from a database to populate the select menu. Here is what I have:code:
The code above is part of a PHP script (thus the \") Any help would be greatly appreciated.
|
# ? Mar 27, 2011 20:44 |
|
Steviepoofs posted:I am trying to change text in one cell of a table based on a selection of a drop down. The data is pulled from a database to populate the select menu. Here is what I have: You can't just tack on made up attributes on an HTML tag and expect them to be accessible in that way. You'll need to parse the OPTION for the attribute you made up either by looping through the attributes collection, or by using getAttribute() but I forget what browsers support that (I think most / all, but check before you use it.) Lumpy fucked around with this message at 22:30 on Mar 27, 2011 |
# ? Mar 27, 2011 22:26 |
|
Lumpy posted:You can't just tack on made up attributes on an HTML tag and expect them to be accessible in that way. You'll need to parse the OPTION for the attribute you made up either by looping through the attributes collection, or by using getAttribute() but I forget what browsers support that (I think most / all, but check before you use it.) Thank you for getting me on the right path... code:
|
# ? Mar 27, 2011 23:26 |
|
Is jsdoc-toolkit still the best/only game around for inline documentation?
|
# ? Mar 28, 2011 23:50 |
|
YUI Doc looks pretty good to me. I don't use it but it was suggested in a book about Javascript Patterns I sorta read a few months ago.
|
# ? Mar 29, 2011 00:02 |
|
I have a pondering about javascript and captchas and probably spambots more than anything. Can you add a captcha to a form via JS? Essentially have a script that detects each submit button and overwrites the events to require you to pass a captcha in order to submit? I mean, obviously you can for human users but what I'm wondering is how do spambots work? Do they run as an agent themselves that has to deal with all the javascript? Or are they just scraping the page for form names/fields and then posting data to the form in a way that a dynamically generated captcha would be avoided anyway.
|
# ? Mar 29, 2011 00:18 |
|
smug forum rear end in a top hat posted:YUI Doc looks pretty good to me. I don't use it but it was suggested in a book about Javascript Patterns I sorta read a few months ago. YUI Doc is pretty good, definitely recommend you check out the Dana theme for it if you go that route.
|
# ? Mar 29, 2011 06:34 |
|
I'm trying to get a row of images to scale down to fit the page if the window size is too small for them to all appear on one line without wrapping. So I'm guessing I need a function to find the width of the page, then another one to scale each image down by a proportional amount? I'm a huge newbie to javascript so don't hesitate to make your post as idiot friendly as possible
|
# ? Mar 29, 2011 08:02 |
|
Whole Milk posted:I'm trying to get a row of images to scale down to fit the page if the window size is too small for them to all appear on one line without wrapping. So I'm guessing I need a function to find the width of the page, then another one to scale each image down by a proportional amount? I'm a huge newbie to javascript so don't hesitate to make your post as idiot friendly as possible I threw together this quick page to show you it in action. Just look at the source code and comments, it should be fairly self explanatory, if you have any questions just give me a shout. http://www.iamquaid.com/~knackered/img_resizer/
|
# ? Mar 29, 2011 11:12 |
|
For a project, I'm supposed to make a page that cannot be exited. I thought I could accomplish this through the onunload and onbeforeunload event handlers but all that accomplishes is just calling the page but doesn't stop from leaving (even though I did the simple redirect code of: code:
|
# ? Apr 5, 2011 05:42 |
|
Baggy_Brad posted:Or are they just scraping the page for form names/fields and then posting data to the form in a way that a dynamically generated captcha would be avoided anyway.
|
# ? Apr 5, 2011 10:11 |
|
Baggy_Brad + Master_Odin: you are both going to encounter the same fundamental issue with Javascript... NOTHING you write as javascript can be guaranteed to be run at all on the client side, and if it is run, you cannot be sure it was not tampered with before being run. So you cannot do client side security validation, you MUST redo it server side. Also Master_Odin; what you're trying is, in actual practice, so obnoxious and so at odds with the fundamental workings of a web browser, that I would hope any browser worth its salt has specific checks on the JS engine to stop you from doing it.
|
# ? Apr 5, 2011 11:35 |
|
KuruMonkey posted:Also Master_Odin; what you're trying is, in actual practice, so obnoxious and so at odds with the fundamental workings of a web browser, that I would hope any browser worth its salt has specific checks on the JS engine to stop you from doing it. The browser in question though is Firefox 3.6.x also.
|
# ? Apr 5, 2011 16:17 |
|
Master_Odin posted:For a project, I'm supposed to make a page that cannot be exited. Master_Odin posted:The other parts of the project were making unlimited pop-ups appear (new windows) and having endless notifications. What the gently caress kind of project is this.
|
# ? Apr 5, 2011 16:19 |
|
Browser Domination Sado-Masochism
|
# ? Apr 5, 2011 16:20 |
|
epswing posted:What the gently caress kind of project is this. http://crypto.stanford.edu/cs142/projects/2/project2.html it's 1c. Not my school, but the exact same project document nevertheless.
|
# ? Apr 5, 2011 16:22 |
|
epswing posted:What the gently caress kind of project is this. Apparently the advertising industry has donated enough money to their school to influence the curriculum, and they are hard at work churning out the next generation of annoying browser ad coders? It's actually a pretty cool project for a security-type class though.
|
# ? Apr 5, 2011 17:02 |
|
An infinite loop will stop FF3 in its tracks for a couple minutes iirc...
|
# ? Apr 5, 2011 17:05 |
|
Master_Odin posted:http://crypto.stanford.edu/cs142/projects/2/project2.html Well, this agrees with my thought that its specifically being prevented for security: http://stackoverflow.com/questions/2357625/changing-window-location-href-in-firefox-in-response-to-an-onunload-event Which marries up with what you would hope (user intent trumps programmer intent when they conflict at the client side). It also marries up with a little bit of experimenting I did here. This also has some info on how onbeforeunload is apparently not a normal event anymore: http://stackoverflow.com/questions/1119289/how-to-show-the-are-you-sure-you-want-to-navigate-away-from-this-page-when-cha Its possible your course hasn't been updated in the face of updates to browser secuturity (also possibly your school is blindly reusing another school's resources, and has only the old, obsolete material) Time to ask your tutor for their exemplar answer to this problem. For extra credit; post it here. (whether or not it works; if it doesn't work, post your tutor's explanation of that...) Edit; there's problably a version of FF before which it worked. Its before 3.6.16, I know that... KuruMonkey fucked around with this message at 17:26 on Apr 5, 2011 |
# ? Apr 5, 2011 17:19 |
|
rt4 posted:An infinite loop will stop FF3 in its tracks for a couple minutes iirc... I don't think an infinite loop should kill any browser as long as the loop is doing something, otherwise things like Sproutcore that have a run loop wouldn't work. This works fine, but modern browsers have a 'stop alerting me fuckwad' checkbox these days. Replacing alert with console.log pretty much causes the tab or browser to be unusable. a = "he's climbin in your windows-he's snatchin your people up-tryna rape em so y'all need to-hide your kids, hide your wife-hide your kids, hide your wife-hide your kids, hide your wife-and hide your husband-cuz they're rapin errbody out here-you don't have to come and confess-we're lookin for you-we gon find you-we gon find you-so you can run and tell that,-run and tell that-run and tell that, homeboy-home, home, homeboy".split("-"); for(var i = 0; i<=a.length; i++) { alert(a[i]); if (i === a.length) { i = 0;}}
|
# ? Apr 5, 2011 17:40 |
|
KuruMonkey posted:Time to ask your tutor for their exemplar answer to this problem. code:
edit: It works in a "if you have poo poo timing 800 times you won't leave the page" but after just randomly clicking a link, I leave the page like 8 out of 10 times. Master_Odin fucked around with this message at 19:52 on Apr 5, 2011 |
# ? Apr 5, 2011 19:40 |
|
Master_Odin posted:He gave me: Well; credit where its due; works for me in Safari code:
|
# ? Apr 5, 2011 20:00 |
|
|
# ? May 15, 2024 09:44 |
|
KuruMonkey posted:Well; credit where its due; works for me in Safari
|
# ? Apr 5, 2011 20:07 |