javascript

Javascript check yield support

Hi, i read about the yield keyword in javascript and i need to use it in my project. I read that this keyword has been implemented starting from a certain version of JS so i think that old browsers don't support it (right?). Is there a way to check if the yield keyword is supported? or at least is there a way to check if the version of ...

JavaScript not working in Firefox

Hi ' im having a problem with my script in firefox, i'm getting the fault , " window.event is undefined " , where seems to be the problem? <script language="JavaScript1.2"> function formattel(){ var value = document.formkkush.telefoon.value; var valueLen = document.formkkush.telefoon.value.length; if(valueLen>2 && valueLen<4) ...

slow-loading javascript include blocks rest of site.

Hi. I have a site with a third-party Javascript include coming from an external URL. However, it frequently loads very slowly (if at all). It is a tracking service used by our marketing team, so I can't remove it (I have suggested it!). Currently it's included at the end of my page template with a very simple <script src='http://remot...

Render google map in wordpress, based on address custom field

I have a wordpress site with a large number of pages, each page represent a physical location. Now for each page I would like to display a google map based on the address. I know I can do this by installing for instance the Geo Mashup plugin http://wordpress.org/extend/plugins/geo-mashup/ but that requires (I believe) that I manually, fo...

Javascript/jQuery Keypress logging

I would like to be able to log the key presses on a specific page, trying to implement an 'Easter egg' type functionality where when the correct keys are pressed in the correct order it triggers and event. Can anyone give me any pointers? ...

Server-side highscores for a Javascript-written game

I'm implementing a simple game in Javascript, and am interested in having an online highscores table for it, so that players can compete against one another. I've two concerns about this: What is the simplest server-side program I need for this purpose? I don't need a full-fledged "web application", just something simple that gets POST...

Javascript refactor

Is there a better way to write this function? I've inherited some javascript code and I'd like to make this more concise if possible. Also, I'll probably be adding many more "theme" elements and don't want to copy and paste over and over. function imageClick() { var theme1 = document.getElementById("li-theme1"); var theme2 = documen...

opposite of <noscript>

Hi, Is there a HTML tag that does the opposite of <noscript>? That is, displays some content only if JavaScript is enabled? For example: <ifscript> <h1> Click on the big fancy Javascript widget below</h1> <ifscript> Of course <ifscript> doesn't actually exist. I know I could achieve the same result by adding <h1> to the DOM using...

tenjin template and javascript output

what is the best way to read a tenjin template with javascript object in it? i am using tenjin template for my PHP based website and i wanted to read a flash/swfobject that is output from tenjin.. has anyone encountered the same issue? ...

JSON in location.hash for AJAX(J) bookmarking?

I'm building an AJAJ (AJAX with JSON) webapp with jQuery and I'd like my users to be able to bookmark a page that saves all of their setting selections for a certain part of the app. I've got quite a bit of data that needs to be saved, so I thought JSON might be the best way to save this, putting it into the location.hash. That being sa...

dynamically updating JS Chart library with animation

Hey, So I'm happy updating a JavaScript chart library to represent new data via Ajax. I'm just wondering if anyone knows of a library that will allow me to do this with a nice animation. Similar to this http://bit.ly/9hJ2rs Preferably free! Thanks Mat ...

DHTMLXtree Grid Caching

I'd like to disable Row Caching in DHTMLXTreeGrid such that every time a row is opened it is realoaded from the server, and not fetched from cache. Is this at all possible? ...

Best way to escape characters before jquery post ASP.NET MVC

Hello, I am semi-new to ASP.NET MVC. I am building an app that is used internally for my company. The scenario is this: There are two Html.Listbox's. One has all database information, and the other is initally empty. The user would add items from the database listbox to the empty listbox. Every time the user adds a command, I call a j...

Prototypal inheritance: Can you chain Object.create?

I'm new to prototypal inheritance so I'm trying to understand the 'right' way. I thought I could do this: if (typeof Object.create !== 'function') { Object.create = function (o) { function F() {} F.prototype = o; return new F(); }; } var tbase = {}; tbase.Tdata = function Tdata() {}; tbase.Tdata.protot...

javascript events and callback

Hi Experts, I am working on a website, where we want user to login using Javascript and not using postback. I have few pages which user can view without logging in, but on these pages if he wants to do something like "Add to favourite" or "Report abuse" or similar, he has to log in. I can display a div where he can log in. But I want t...

Get all input type password

Hi. I'm new in javascript. I want to get all input type password on my html page. I know that there is a way to do this kind off things using Javascript, but I don't know how. Then, with each one, I want to assign an event on text changed. How can I do this? Thanks ...

How to write this regexp?

I am validating a field which may NOT be anything but numbers, but may include a space or a minus-sign. This is for validating phone number field! So, these criterias should be met: (might have forgot a criteria, if so remind me) 1- Atleast 5 numbers 2- May contain space 3- Not shorter than 5 characters 4- Not longer than 20 charac...

How to implement a frame buster?

I'm searching for a guide that describes how to implement a working frame buster that also deals with people that dont have JS activated in their browser. I read this very good question but i'm absolutely not interested in any advice like "dont do that yourself" or "maybe try...". i want to see a paper, with a step to step guide explain...

Fix JS object replacing/encoding of strings?

Hi everyone, I have an object with a value that has spaces in it, and it gets replaced with an encoded string, like: alldata["test"] will return "Long+name" or something like alldata["test"] will return "%BLong+name%B" when it's set by using alldata["test"] = "Long name" (or "[Long name]") via a series of code. Am I missing somethi...

Can I determine which Submit button was used in javascript?

I have a very simple form with a name field and two submit buttons: 'change' and 'delete'. I need to do some form validation in javascript when the form is submitted so I need to know which button was clicked. If the user hits the enter key, the 'change' value is the one that makes it to the server. So really, I just need to know if the ...