javascript

Swap div content from the same text link

I am having trouble resolving an issue using traditional JavaScript and was wondering if there is an easy solution using jQuery. I've searched the web and haven't been able to find anything that does exactly what i want to do. So.. this is what i want to achieve: I have 2 div's with content, first one is displayed, second is hidden. Be...

addEventListener in Canvas tag

Javascript - Canvas tag - HTML5 Hello, I have a canvas tag to create a graphic. At each section of my line, I have a "dot" to enable a 'mouseover' and display more detail. Everything works fine when I don't add an event listener to this dot. Firebug is warning me : s.addEventListener is not a function... Is it possible to create dyn...

Django javascript files

In a Django app, where should I put my javascript/jquery scripts? ...

In what case does IE8 block Javascript and how to avoid it ?

I got a web site using jQuery, jQuery Tools and some handcrafted JS running performing graphical enhancements. While it's running smooth on FF, Safari and Chrome, IE blocks the script execution : There is nothing particularly more dangerous on this code than, let's say, on Netvibes. Why is even talking about activeX ? I'm using JS. ...

Javascript with PHP

Dear users, I have an overlay image that is created in Javascript using the 'Createelement' function. Now I would like to know if I can attach a handler to the mouseover event using PHP? Can you give an example pls? The image appears only when hovering over the element below it. Regards, T UPDATE I want to handle the mouseover...

Check if an object has focus

How can I tell if a certain textbox has focus or not? I'm writing in C# in .NET. ...

UI Checker JavaScript / CSS tool

Hi! I have a task (for instance): create an HTML&CSS according to the given Jpg file. Basically, what i want, is a simple JavaScript lib (or whatever else it might be) which will allow me to see the transparent gif of the original file (50% opacity) and my actual page, so that i could fit all my classes pixel-to-pixel according to Jpeg...

SharePoint Client JavaScript Documentation

I'm attempting to improve the usability of a client's SharePoint deployment via JQuery; and am hitting a brick wall when trying to find any sort of documentation of what's happening in core.js (aside from painfully digging through and trying to parse any sort of meaning out of it --all 250kb of it!!!!--) Anyone have any pointers, or doc...

How can I get the current document area size in javascript in IE, Firefox, Webkit?

I need cross-browser compatible Javascript code that will return me the height and width of the current document area in all three browsers (IE, Firefox, Webkit [Chrome/Safari]). I don't need the entire window size (as it is on the desktop) but the height and width of the document as it pertains to CSS layout. Thanks ...

IE exec command rich text editing

I'm tring to insert an image in a WYSIWYG editor, but I can't insert images in Internet Explorer(6/7), although it works fine within Firefox. It fails without throwing any errors. This is what I'm using: execCommand('insertImage', false, 'absolute/path/to/an/image'); ...

Referencing JSON response to POST of form data with jQuery and the Form plug-in

I'm having trouble understanding how to use jQuery and its Form plug-in to access the data returned by an HTTP post operation. For example, I would like to POST data in a form from a browser, process the data on the server, return a server response (in JSON) to the browser, and display information about that response to the user in an a...

Extjs: How to change tree node attributes?

How can I change the attributes of a tree node? One tree node has the following attributes: {"id":"75", "description":"My Tree Node", "status":"25" "uiProvider":"col", "leaf":true} Now my script receives the following data { "id":"75", "status":"100", "cls":"done" } I try to update the attributes (UPDATED): // a.result.data has t...

widget for implementing auto complete for search engine

I'm putting together a search engine. I need a text field (with autocomplete) and a Search button. (Clicking the Search button submits the form.) There are many javascript autocomplete solutions out there (some are listed at http://webtecker.com/2008/03/10/10-auto-complete-ajax-scripts), but I need one that works in tandem with the Se...

Checkbox onChange submit problem if checked

The purpose is to have a checkbox, that if clicked, will send via post where I will update the db. The user can check back and forth to set or unset active status. This works perfectly: <form name='form".$value['id']."' action='./filter_edit.php' method='post'><input type='checkbox' name='checkbox[".$value['id']."]' value='".$newActive...

Is it Possible to Force a Login Depending on the IP Address?

I am trying to deter bots from surfing my pages. So I want to force a login from all Ip Address that are not the top 4 search engines. Is this possible? ...

What is the correct way to write HTML using Javascript?

I see in some posts that people frown upon using document.write() in javascript when writing dynamic HTML. Why is this? and what is the correct way? ...

What happens if you use a <script> tag with the same "src" attribute multiple times within a single HTML document?

Although I am almost certain the answer to this question will be browser specific, do any of the browsers define behavior for when multiple <script> tags are used and have the same src attribute? For instance... <script src="../js/foo.js"></script> ... <!-- what happens here? --> <script src="../js/foo.js"></script> The reason I ask...

jQuery Email Address Input

I'd like an autocomplete/autoformat "To" field on my web site that works like the one in GMail: Does anyone know of such a thing for jQuery? Plain JavaScript? Or any other alternatives? ...

Input Type=Image "On" without onclick event

I have a form with an input type=image. It used to have a confirm in its onclick that returned true/false allowing/stopping the form submit. I've recently 'upgraded' to a non-modal dialog with a callback handler. Since the callback handler is non-modal, the return value to the input is always false, don't submit... When I submit upon...

Flickering element, not resolved

Hello, I have a PHP page with the following code: echo "function createimg() { var img = new Image(); img.src='path/to/image'; img.alt='Next image'; img.id = 'span1'; img.style.zIndex = 10; img.style.position = 'absolute'; img.style.display='none'; img.style.top = '130px'; img.style.padding='10px'; img.style.left='440px'; img....