I have an input box… When I type in the field, it will go to function lookup(). From there I want to get the id of this input. I tried… but this won’t work. Any suggestions on how I can get the id? Answer Because you are passing this.value to your lookup() function. It’s better to pass…
Tag: javascript
JavaScript, regex: How to fetch mail address in mailto: links
Is there a jquery plugin or may be a regex which can be used to all the fields in query string of a mailto: link. It should support the mailto syntax. Say if I have a link like … The regex should give me the mail addresses in mailto: link – astark1@unl.edu, id@internet.node. It should also support…
jQuery resizable event does not end
I am making some interactive UI and using jQuery for resize and mouse events. I bind mouseOver and click event for all elements and when I get a click, I remove the click listener (so that it does not interfere with the resizable listeners). This works fine till here, now the selected element can be resized. …
Dynamically disable select menu based on text field value
I’d like to be able to disable a select menu on my page when a user starts typing in a text field. This is because the text field is an alternative way to enter the data and disabling the dropdown menu will help make that clearer. I know I could use this: to disable the select permanently, but is there
Change the Value of h1 Element within a Form with JavaScript
I have two forms on an HTML5 page. Each form has a name and an id. The second form has an h1 element, which also has a name and an id. How do I change the text of this h1 element on the second form using plain JavaScript? Answer Try: document.getElementById(“yourH1_element_Id”).innerHTML = “…
Verify External Script Is Loaded
I’m creating a jquery plugin and I want to verify an external script is loaded. This is for an internal web app and I can keep the script name/location consistent(mysscript.js). This is also an ajaxy plugin that can be called on many times on the page. If I can verify the script is not loaded I’ll…
How to set a Header field on POST a form?
How can I set a custom field in POST header on submit a form? Answer It cannot be done – AFAIK. However you may use for example jquery (although you can do it with plain javascript) to serialize the form and send (using AJAX) while adding your custom header. Look at the jquery serialize which changes an…
Access variables and functions defined in page context using a content script
I’m learning how to create Chrome extensions. I just started developing one to catch YouTube events. I want to use it with YouTube flash player (later I will try to make it compatible with HTML5). manifest.json: myScript.js: The problem is that the console gives me the “Started!”, but there …
Geolocation: Mapping and POI with OpenStreetMap
I’m making a website, where the visitor gets its position showed on a map and within a chosen radius (e.g. 10km) the visitor can see some POIs (e.g. Restaurants, Bars). I have this code so far: It shows me my position on a map with a marker using Google Maps. The thing is, I would like to use the maps
iframe js issues
I’m new to web development and js. I understand some js and jQuery, but not enough to write useful code yet, so I’m hoping to get help here. I’m incorporating some 3rd party web apps into my website via an iFrame (out of pop-up windows and direct links, this is the best way) and have a two p…