|
How about embedding js in a png and execute it? http://www.pouet.net/prod.php?which=59298
|
# ? May 31, 2012 15:04 |
|
|
# ? May 16, 2024 17:11 |
|
KARMA! posted:How about embedding js in a png and execute it? That site seems incredibly dodgy. Thanks for the link!
|
# ? Jun 1, 2012 10:53 |
|
Sergeant Rock posted:That site seems incredibly dodgy.
|
# ? Jun 4, 2012 15:41 |
|
Sagacity posted:What's dodgy about Pouet? It's quite awesome. It looks and feels like oldschool sites. Not that I would know anything about those...
|
# ? Jun 4, 2012 16:58 |
|
Sorry if this has been asked before: what is the best way to make apache and node.js play nicely together? I'm seeing a lot of different options but nothing really jumps out at me as "best"... Edit: screw it, I'm just testing and evaluating so it doesn't matter right now anyway. My Rhythmic Crotch fucked around with this message at 21:37 on Jun 4, 2012 |
# ? Jun 4, 2012 21:25 |
|
My Rhythmic Crotch posted:Sorry if this has been asked before: what is the best way to make apache and node.js play nicely together? I'm seeing a lot of different options but nothing really jumps out at me as "best"... Why would you use Apache as a frontend server for node.js? Why not use nginx as a caching reverse proxy? Or squid or varnish or whatever the young'ns are using nowadays? Apache is a good/standard application server, but I don't know that it has any advantages as a frontend web server. In any case, if you go ahead, you'd probably want to have Apache use mod_proxy. I think turning keep-alive off between Apache and your application server might be a good idea, since they're internal servers. I don't know the intricacies of deployment but if you really need to know I can put you in touch with some of my friends who founded a company who does cloud node.js stuff and so probably know a good amount about deployment. I'm sure they' be happy to answer a few questions based off their production experience. EDIT: oh. guess you don't care right now.
|
# ? Jun 4, 2012 21:38 |
|
Munkeymon posted:It looks and feels like oldschool sites. Considering that the demoscene grew out of the warez scene, why wouldn't they share similar visual elements?
|
# ? Jun 5, 2012 02:43 |
|
thelightguy posted:Considering that the demoscene grew out of the warez scene, why wouldn't they share similar visual elements? I'm not complaining - just explaining
|
# ? Jun 5, 2012 21:17 |
|
Anyone here have some backbone experience to help a newb with? I am trying to make a leaderboard, where you have a vote link for each person and when you click on it it increments a vote attribute in the model (Player). I have a model (Player), a collection (PlayerList) and two views, one view for displaying how the Player looks on the leaderboard, and one view to display all the Players My question is, how do I set it up so that when a player receives more votes than the player above him, it updates the view? The collection is maintaining the proper order of the list, but I can't figure out how to update the view. I am not sure if I'm suppose to just clear out all the Players and then redraw the leaderboard, or if there is a way in backbone to just update the player view for the Player and the Player's he's overtaking.
|
# ? Jun 7, 2012 17:19 |
|
can you post any code? can't you just trigger a render on the view when that condition is met? like: on model change, call some method that checks a player's votes against other player(s) votes. if the player's votes are higher, re-render the collection (assuming you have a collection view)?
|
# ? Jun 7, 2012 19:17 |
|
smug forum rear end in a top hat posted:can you post any code? can't you just trigger a render on the view when that condition is met? And also the person at the top of the leaderboard as a different view, but I'll worry about that once I can get it ordered. http://jsfiddle.net/eTD2t/ Edit: Well it looks like I fixed it by clearing the entire view, then redrawing the entire board based off a reset event from the leaderboard. Strong Sauce fucked around with this message at 05:27 on Jun 8, 2012 |
# ? Jun 8, 2012 05:04 |
|
This could be a PHP, or search engine, or JS, or ajax question I guess... But it has to do with javascript manipulation of DIV tags in reference to search appliances. I have a PHP template that uses ajaxpage to load content from a tabbed interface. We also have an in-house GSA (Google Search Appliance). The GSA doesn't crawl the ajaxpage content apparently because the content isn't loaded when the page is rendered. So I'm thinking of rewriting it so I have the content loaded up with PHP into separate DIVs (it's only 4 tabs and very little content in each) and use JS to alter the CSS display property between block/none and adjust the height of the container to fit the content. Question is, if I rewrite it as described, will the GSA crawl the content in the display: none DIVs or skip it entirely?
|
# ? Jun 12, 2012 00:16 |
|
The crawler probably ignores any css. In case it doesn't, you could try CSS code:
CSS code:
|
# ? Jun 12, 2012 06:03 |
|
How do I display a box like 'do you really want to quit' when you try to close the browser, but not when you click a next-button or anything else in JQuery?
|
# ? Jun 12, 2012 14:33 |
|
Boz0r posted:How do I display a box like 'do you really want to quit' when you try to close the browser, but not when you click a next-button or anything else in JQuery? Have an onbeforeunload only trigger if a particular variable is true, and if someone clicks something that would send them off the page, set that variable to false. The setting will happen before onbeforeunload happens, so if they close the window they get the popup, but if they click a button or whatever they don't.
|
# ? Jun 12, 2012 15:23 |
|
Boz0r posted:How do I display a box like 'do you really want to quit' when you try to close the browser, but not when you click a next-button or anything else in JQuery? I did this a while back for a js class I built. In a nutshell... something like this with different handlers for different browsers because not all of them are onbeforeunload aware. Season to taste with what Golbez mentioned and you should be set. You could replace the saveStats() call with some other method you build or whatever, or just go with the straight alert message. code:
burnt_offerings fucked around with this message at 23:29 on Jun 12, 2012 |
# ? Jun 12, 2012 21:10 |
|
burnt_offerings posted:
People please, use a debugger, it's not 2002 anymore. Seriously, just put a breakpoint in your code and either add browser and navindex in your watches, or use the console to evaluate your values in real time.
|
# ? Jun 13, 2012 05:33 |
|
Jesus that code is awful. You can detect the attachEvent / addEventListener and wire up the appropriate events (even using both unload & beforeunload wired up would be better than detecting which browser to wire up each)
Funking Giblet fucked around with this message at 09:12 on Jun 13, 2012 |
# ? Jun 13, 2012 09:03 |
|
Funking Giblet posted:Jesus that code is awful. You can detect the attachEvent / addEventListener and wire up the appropriate events (even using both unload & beforeunload wired up would be better than detecting which browser to wire up each) Yeah, I agree its not pretty and not elegant either. I'm not all that awesome at js. It works though. And now that you mention it, that probably is a much better way of doing it. I'll look into that. Thanks for the critical eye.
|
# ? Jun 13, 2012 15:25 |
What do you guys think is the best way to handle this situation: The framework for some software my company is using has a ton of calls to retrieve a form field and then interact with it in some way, like this: getField(fieldName).interaction(); Unfortunately we want the customer to be able to remove any fields they want. This means that getField() will return null if the field isn't present. Considering I've been told not to mess with getField(), what would you do? My plan was to wrap it in a new function, sort of like this: code:
Oh, I should also mention we want that debug scenario in there, which is why I don't just do if (getField()) {getField().interaction()}. Polio Vax Scene fucked around with this message at 17:29 on Jun 13, 2012 |
|
# ? Jun 13, 2012 17:25 |
|
Looks fine to me.
|
# ? Jun 13, 2012 17:33 |
|
Is there some library for doing browser detection? I promise to use it only for good (if at all)
|
# ? Jun 13, 2012 19:19 |
|
Wheany posted:Is there some library for doing browser detection? I promise to use it only for good (if at all) Closest I've seen is the old navigator.useragent business; W3Schools may be bad at some things but not everything. JQuery apparently includes some browser detection, though not the best. MDN has dox on how to detect browsers, though they warn it's a bad idea. Never used any of them except jQuery, but apparently from some googling, most frameworks include browser-detection. Dunno if anybody would go to the trouble of writing a full library for that purpose.
|
# ? Jun 13, 2012 19:36 |
|
It really depends on why you need to detect the browser. Some things are very trivial, some very difficult to get 100%.
|
# ? Jun 13, 2012 19:44 |
|
Well for what I would use it, it wouldn't need to be 100% accurate. The accuracy I need would be fulfilled with searching for chrome, safari, opera, firefox (maybe gecko) and IE in the user agent. I just thought that I might get to be lazy.
|
# ? Jun 13, 2012 19:52 |
|
Do you need to specifically detect browsers or what the browser supports? It's probably better to use something like modernizr to do this kind of thing.
|
# ? Jun 13, 2012 20:44 |
|
Naah, it's just "It seems you're using <some browser>, here are instructions specific to your browser". If I don't recognize the browser, or if javascript is disabled, I just show everything.
|
# ? Jun 13, 2012 21:26 |
|
Wheany posted:Naah, it's just "It seems you're using <some browser>, here are instructions specific to your browser". If I don't recognize the browser, or if javascript is disabled, I just show everything. Like darth mentioned jQuery.browser will provide you with an easy way to check for - "webkit (as of jQuery 1.4) / safari (deprecated) / opera / msie / mozilla and you can get the browser version number off $.browser.version too.
|
# ? Jun 14, 2012 03:16 |
|
I've found Safari difficult to detect as it seems any Webkit browser also has "Safari" in its user agent. If you're going to do this, I'd suggest a "not your browser?" link which then shows all the different browsers and their instructions. User Agents really need to be cleaned up...
|
# ? Jun 14, 2012 14:43 |
|
Well, this is what I was going for and it is pretty much as accurate as it needs to be: http://wheany.com/browserdetect/
|
# ? Jun 14, 2012 15:34 |
|
The Merkinman posted:User Agents really need to be cleaned up...
|
# ? Jun 14, 2012 20:40 |
|
Gazpacho posted:Well, keep in mind they got into this situation because of code that explicitly checked the browser ID, leading browser devs to spoof the browser ID for the sake of that short-sighted (or downright hostile) code. This is why the jQuery folks are working to eliminate the browser property. If user agents are just going to include the same strings and spoof each other, then what's the point of having them at all?
|
# ? Jun 15, 2012 15:08 |
|
The Merkinman posted:I know, but nowadays I think (hope) that web developers would only use it for things like what Wheany wants, or metrics (X% use Y browser). No more "best viewed in IE with 800x600 or higher resolution. Nothing at all. User agents are dead, long live feature detection!
|
# ? Jun 16, 2012 10:14 |
|
Uh, is there a reason you need to know their browser, and not just features? I would think that "your browser doesn't support x" messages (based on feature detection and not the browser they're using) are way more helpful than assuming that the browser will be configured exactly as expected. What are you even making that would act so differently on every browser? I guess my point is that browser sniffing is sort of fragile. The page you linked to is also not smart enough to identify Opera masked as Firefox as Opera (and I have definitely come across pages which can't be fooled in that way).
|
# ? Jun 17, 2012 20:46 |
|
Different browsers have different uis, so howtos, for example, need to be different across browsers. Also, shock that Opera spoofing as Firefox fools a script that does indexOf on the user agent.
|
# ? Jun 17, 2012 21:39 |
|
Is there an easy way to use code from one .js file in another, like how other languages have import? I got bored and decided I wanted to throw together a simple ray tracer in javascript, but I'd rather not stick all my code in one file while I'm coding, if I can avoid it.
|
# ? Jun 18, 2012 04:59 |
|
Safe and Secure! posted:Is there an easy way to use code from one .js file in another, like how other languages have import? http://requirejs.org/ ?
|
# ? Jun 18, 2012 05:36 |
|
That looks like what I want. Thanks!
|
# ? Jun 18, 2012 05:46 |
|
Yes, require.js is exactly what you want
|
# ? Jun 19, 2012 00:26 |
|
|
# ? May 16, 2024 17:11 |
|
smug forum rear end in a top hat posted:Yes, require.js is exactly what you want Require.js is dogshit and you should never use it, or any "module loaders". Use server side to prooess the output file.
|
# ? Jun 21, 2012 21:37 |