javascript

Internet Explorer 8 - setTimout redirect to different page

I am trying to redirect the user to a different page after 1 second via javascript: setTimout("document.location.href='new_page.html'", 1000); however, in Internet Explorer, this happens immediately, not 1 second later. Any thoughts? ...

"Permission denied to access property 'href' from a non-chrome context" in JavaScript and OpenLayers

This is really two questions one leading into the other. Firstly what does 'Permission denied to access property 'href' from a non-chrome context' actually mean? Secondly I am using overlays in OpenLayers and wish to change the opacity of said layers, this is where this error is being thrown the code of which is here... <input id='opac...

jQuery queue on matched set

I'm trying to trigger a sequence of effects (simple animated show/hide) on a group of images inside of div where images are tagged with classnames that provide a filtering ability thru class selectors. <div id="myDiv"> <img class="tag1 tag2 tag3" ... /> <img class="tag2 tag3" ... /> <img class="tag1 tag2" ... /> ...mor...

How to append parameter to given url in javascript??

I want to append some value to given URL. Suppose var name = "ABC"; I want to append ABC to url say "http://www.mysite.com" How to append name "ABC" to above url?? ...

How to embed jQuery/javascript in JSF XML

Hello I'd like to focus on the first h:inputSecret component in my RichFaces rich:modalPanel. I've read I need to use the javascript I've included in the list below but it simply doesn't work (Win FF). Can anyone tell me why not? I've tried autofocussing on id="Form" and giving the panelGrid an id and using that to no avail. Any help...

Remake of this "contact form" to send out emails (Ajax)

I have followed this tutorial, and made everything like the tutorial says... When I click submit it says "this wont actually send out emails". Here is the tutorial So my Q is this, would it be too hard to "actually send out emails" with this? How can I implement it into this? Thanks PS: No JQuery please... ...

jQuery Selector issue finding href with text category1 in it

i have a set of hyperlinks with href = javascript:method('category1') and likewise category2 category3 ... I want to select hyperlink with href containing category1 so i have written jQuery(a[href*='category1']) but dont know why it also selects hyperlinks with category10 category11 category12 ... also I understand that category1 is...

Javascript in UIWebView callback to C/Objective-C

Is there a way to get a callback to objective-c when a certain event has been detected in a UIWebView? Can Javascript send a callback to Objective-C? ...

jQuery Horizontal scroll with unknown width of items

I am creating a gallery using jQuery which displays pictures horizontally, with a "left" and "right" button below, that scrolls the row of images. There are plenty of tutorials and plugins for this. The problem for me though, is that 1) I don't know the width of the images. And 2) I need the item I scroll to, to be centered. How do I g...

How do I return a value from a javascript function

Say I have a function function myFunction(myValue) { // do something } How would I return a value from this, say a string type after the method is executed? ...

ASP.NET MVC: Ajax.Actionlink Does not work with parameters

<%= Ajax.ActionLink("DrillDown", "EventOverzichtAjax", new { GroepID = Model.GroepID.ToString(), groepType = Model.GroepType.ToString(), manager = Model.isManager }, ...

Skip video in youtube playlist using javascript

I've looked through the YouTube JS API, but can't find a way to jump to a video in a playlist. (Mimicking the built-in navigation) And if you're wondering why I'd want both, it's because I have a menu set up with additional information, and want to let the user click these links to jump between the videos. ...

Issue with changing an attribute with jquery

Hello, I'm having an issue with changing the attribute for an id and can't seem to figure out what I'm doing wrong. I guess it doesn't help that I'm new to this also. I have a function that tests to make sure that I am pulling the correct id from the row in my form that I have dynamically created. It goes something like this: myFunctio...

Touch events are not triggered on video tags on safari for iPhone

I want to prevent the scrolling on a safari web page for iphone by binding the preventDefault method on the document element of the DOM, and it works on every elements but the video tag. document.addEventListener("touchmove", function(e){e.preventdefault();}, false); I've tried attaching the event to the video tags, but it seems as if...

jQuery.clone() IE problem

I'm have some that uses jQuery.clone() to get the html of a page and then add it to a pre tag. It works correctly in Firefox and Chrome, but nothing happens in IE: <!DOCTYPE html> <html> <head> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt; <meta charset=utf-8 /> <title>JS Bin<...

How do I alter the XML DOM with javascript, when using XML+XSLT client side.

For example: XML: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="example.xsl"?> <document> <foo>bar</foo> </document> XSL: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:template match="/"> <html> <head> <title>example</title> ...

Using getElementsByName without starting at document root.

Is there a way to use getElementsByName without starting from the DOM root. For example I have a div element, and want to start searching from that element. If not, then do I have to write my own function that recursively iterates through the child nodes, or is there a different way to do it. ...

Which StackOverflow-style MarkDown (WMD) javascript editor should I use?

Background I'm working on an application which requires user-entered content, and I've decided to use a StackOverflow-style MarkDown editor. After researching this topic for the last few days, I realize there are numerous forks of the base WMD editor, some with a few basic enhancements and some with serious differences from the StackOve...

How to disable an input type=text with javascript?

Hi, I want to disable writing in an input type text using javascript. The input type text is populated from database that is why I don't want the user to modify its value. Thinks for help. ...

What does this do?

I found this. What does it do? function G(a, b) { var c = function() { }; c.prototype = b.prototype; a.T = b.prototype; a.prototype = new c; } It looks very similar to Crockford's Prototypal Inheritance in JavaScript. Stackoverflow: What is happening in Crockford’s object creation technique?. ...