javascript regular expression select html element with class="product" from string
lets say i use jquery.get to retrive a website to string and how am i gonna select the whole table with class=product from it? $() seem cant work on string .... ...
lets say i use jquery.get to retrive a website to string and how am i gonna select the whole table with class=product from it? $() seem cant work on string .... ...
Is there a ActionScript-version of JavaScript's Canvas.clearRect()? I only know graphics.drawRect(...) which allows me draw but not remove rectangles. If there is no such method in ActionScript, how can I emulate it? ...
Hi! I have a javascript "loading" function like this: function splashScreen() { var div = document.createElement('div'); div.appendChild(document.createTextNode("some text")); div.style.position = "fixed"; div.style.width = "100%"; div.style.height = "100%"; div.style.left = "0"; div.style.top = "0"; div....
After googling around and finding a lot of ie bugs I still did not find a description of the problem I have. The initial situation is a standard one. We have a tooltip which is actually a hidden div that will be displayed on mouseover at a given location. The div is hidden with display:none and contains a table with the content. We trie...
Hello I have following markup and javascript to sort some items. Items can be sorted within a block or across other blocks. It works but I have a problem in retrieving correct block ID after an item is moved from one block to another. For example, if I move item 1 within "Block 1", I get "I am in Block= block_1" but if I move Item 1 t...
I am currently working on a page that has a date picker for one of the field. One of the requirements by my client is to prevent the user from editing the field manually. Only the date picker would be possible to be used. (jQuery DatePicker) I had in mind to disable the field and use an hidden field to store the data (disabled from ob...
I'm specifically referring to JavaScript anonymous function but this could be relevant to other languages. I like to use JSDoc notations in my scripts because I know other people will be hacking at it sooner or later. When i have pretty complex anonymous function how do people document it so that it gets picked up by Eclipse and other ID...
Question: How can you use the JQuery Auto-Completion plugin to suggest a location ("City, State") for an input field? Meaning, someone wants to type in "Chicago, IL" ... so they begin typing "Chi" and it auto-suggestions "Chicago, IL". My biggest hurdles is finding a service that I can query to find out all US city+state names. I esse...
Hi Stackoverflow, I have been looking at the source code of raphael (http://raphaeljs.com/index.html) and I see a lot of stuff like !variable && function() (e.g.: !svg.bottom && (svg.bottom = this); ) What does that exactly do? Does it check first and execute only if not true? Thanks. ...
Which method is faster or more responsive in javascript, if/else or the ternary operator? Is it preferred to use one or the other and if so, for what reasons? ...
Hello, This question mixes client-side scripting with server-side parsing. In some cases, I'm writing a cookie to the user's browser using the document.cookie property. In other cases, I'm writing the same cookie to the user's browser through the ASP.NET Response object. When I'm writing the HttpCookie on the server-side, I am using ...
So I currently have three unordered lists in my header. This is a single-page site that uses anchors to navigate. I need to have an "active" class to toggle between any anchor that is clicked between these three unordered lists. I still relatively new with jQuery and programming in general, but the basic structure of the page is outlined...
The client wants to have a simple slideshow with a little twist: he wants the menu to be on top of the image being changed. what would be the way to achieve this using css and javascript? ...
Hi All, I have an app that includes a search feature. This feature is implemented by having a user type a term in a search bar. Once the user enters 3 characters an ajax call is started. I thought that this would be enough, but it turns out that there's a bug that I think has to do with timing and the fact that several ajax calls can...
I have something like this: var test = {}; function blah() { test[2] = 'filled'; } blah(); // ! Hopefully confusion is now averted.. console.log(test); //result test -> 2:"filled" console.log(test[2]); //result undefined I don't understand why I'm getting 'undefined' in the second instance when according to the first instance...
Hello, I'm working on a website using extensively javascript. The code I'm working on also rely on other big javascript libs. The thing is that somewhere in these libraries, some alert box are poping. I was wondering if there are some way to disable the javascript alert box on the fly and re-enable it later. Thanks ...
I ran across this chunk of code (modified) in our application, and am confused to how it works: function someObject() { this.someProperty = {}; this.foo = { bar: { baz: function() { return "Huh?" } } }; this.getValue = function() ...
I'm building an ASP.net custom control that implements IScriptControl. I would like other users of my control to be able to assign client-side event handlers to the control. Unfortunately the JS generated by IScriptControl is always injected at the very bottom of the rendered page (see below), so any attempt to assign an event handler in...
I was adding recent videos gadget on my blog. In that widget i was supposed to add this line <script src="/feeds/posts/default?orderby=published&alt=json-in-script&callback=showrecentpostswiththumbs"> also, i added another script which was having the method showrecentpostswiththumbs [ used in callback ]. Please let me know what does ...
Hello, I have spent the whole day trying to make a script which on "submit" hides the form and shows hidden with animated progress bar. The problem is that Internet Explorer doesn't show animated gif images in hidden divs. The images are static. I visited many websites and found a script which uses: document.getElementById(id).style.ba...