javascript

Jquery event on a disabled input

Aparently a disabled input is not handled by any event (am I wrong ?) Is there a way to work arround this problem ? <input type="text" disabled="disabled" name="test" value="test" /> $(':input').click(function () { $(this).removeAttr('disabled'); }) Here I need to click on the input to enable it. But if I don't activate it, the in...

Possible to use slash (/) instead of hash (#) without page refresh window.location?

I use 'window.location.hash' to add '#something' to the URL without refreshing the page. I want to know how to do the same but using a slash (/) instead of hash (#). Why? I have navigation tabs and I use a jQuery and Ajax to dynamically load the data. When javascript is enabled, '#something' is added to the end of the URL to get the da...

How do I use SVG images interchangably with PNGs in Firefox?

My project supports users uploading their own icons to be used for various entities in the system. I'd like to support SVGs, as this means that the same image can be scaled nicely and thus used in multiple places. Firefox has a current bug that prevents SVG files being used in <img> tags. It was my understanding from my other xhtml work...

Limit allowed file types or Get file name of selected file

Hello all, I am trying to find out how to allow users to only select certain files when the file browse window opens when an input of type file is clicked. I couldn't come up with a solution for this. Any ideas? I thought the accept attribute would work but I didn't get much luck with that, is the below implemented correctly? <input id...

Invoking javascript in child page from master page

Hii, I have function established in child page, that is using in the childpages. I have to invoke the child page function from the master page. How it is possible in javascript ...

Adding parameter to URL?

Hi If i wanted to add 2 suppose name and id values to URL. How can i do that using JavaScript? Suppose we have URL http://localhost/demo/ then how to add these 2 parameters... Thanks.. ...

Want to add popup entry in Allow popup option of firefox using javascript

Hi Guys , I want to add popup blocker entry for the specific site in htmlunit webclient we can do it manually by clicking to edit popup blocker entry option in browser but how to do it in htmlunit is it possible ? if yes ......how? I want to do this in htmlunit Thanks ...

how do a select option selection pick from some other page using html and js only?

Hi friends, I have to main pages in html with course details. One (X) page has html select option with all courses. If i select in any pages and any one course to apply, then i redirect to X page to user that option has selected by default in X page. I have idea to pass value in url, but how can i retrive the correct option in X pag...

Change the scroll of an hidden div

Hi, I have an hidden div with a fixed height and a scrollbar. I would like to change the scroll position, but the browser won't le me do it, as the div is hidden. The scrollTop property will stick to 0. Also, I don't want to show and hide the div back, which causes flickering. If anyone knows how to do it, it'll be really helpful. Th...

jQuery: Get attributes from "live" element

Hey, I create a new window when i press a button. This window contains html input elements that i want to manipulate with jquery, but i can't catch the elements. Normally i would use the live function because the html is first added to the dom when the button is pressed, but its not working. jQuery(document).ready(function () { va...

iframe query string

Hi, I have got the values by passing the query string in an iframe.src = "xyxz.jsp?name="+name+"&pass="+pass+"&id="+id. I need to pass those values which i have got to another jsp page <iframe src="xyz.jsp"></iframe> How can i do that? ...

Get div height in pixels although its height set to 100%.

I wonder if there is any way to get div height in pixels, although its height set earlier to 100% height. This is required as div content is dynamic so div height has different values based on content itself. [Edit] Div by default is hidden. I need to get div height in pixels for later manipulation (smooth scrolling will be done for ...

jQuery URI encode (char &) .html() attribute value

I've read a lot of the HTML encoding post for the last day to solve this. I just managed to locate it. Basicly I have set an attribute on an embed tag with jQuery. It all works fine in the browser. No I want to read the HTML itself to add the result as a value for an input field to let the user copy & past it. The PROBLEM is that the .h...

How can I select which text will be used when sharing with AddToAny?

We are using AddToAny to put share buttons on our pages. When sharing to FaceBook for example, it picks the correct title, but it picks the wrong text. My guess is that it uses the first <p> it finds. This is in many cases not correct, since we have <p>s in a column on the left of the page, but the main text is in a bigger area (later on...

Whether this function is correct or not ?

Hi, alert(window.location.href/&name=" + escape(name_var) + "&id=" + escape(id_var)); thanks ...

How to find 1 X 15 array from 3 X 15 array?

Im trying to create 1 X 15 dimension unique array from 3 X 15 array. I am not able to achieve this .Please help me on this . Thanks in advance. The 3 X 15 array was Array[(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3),(1,2,3)] ...

assign matched values from jquery regex match to string variable

I am doing it wrong. I know. I want to assign the matched text that is the result of a regex to a string var. basically the regex is supposed to pull out anything in between two colons so blah:xx:blahdeeblah would result in xx var matchedString= $(current).match('[^.:]+):(.*?):([^.:]+'); alert(matchedString); I am looking to get ...

Dynamically added AJAX content with wrong markup

i am using jQuery to dynamically add content $("#articles").prepend('<article><header><p>info</p><h2>You are using Internet Explorer</h2></header><p>It is recommended that you use a modern browser like Firefox, Chrome or install Google Chrome Frame to experience better performance and advanced HTML5 and CSS3 features.</p></article>'); ...

Un-obtrusive modal window in external site

Sorry for the title.....bit difficult to word what I really want to ask. Some websites allow a user to copy and paste some widget for use with their own site. For example, getsatisfaction. Yes, those feedback icons that I hope most of you see in various places. If you have a look at twitterfeed, on the left there will be a feedback ico...

Is looping events in JavaScript using document.dispatchEvent possible?

I'd like to create an event loop mechanism in JavaScript/DOM using only dispatchEvent calls. For example: document.addEventListener("LoopingEvent", loop, true); var loop = function() { doSomeWork(); updateUI(); document.dispatchEvent(loopEvent); }; var loopEvent = document.createEvent('Events'); loopEvent.initEvent("Loopin...