javascript

Check contents of a hidden field in javascript.

I have a hidden field and I add string to it, separated by semicolon. How I can I check the duplication when adding a new string? I am doing as function AddToHiddenField(source, hdnFiledId) { var srcList = document.getElementById(source); var hdnFieldSubstring = document.getElementById(hdnFieldId); var len =...

IE 7, Javascript transparent div onclick

Well i have a transparent div or the background is set to transparent :) css: #lowerLayer { position: fixed; top: 0px; left: 0px; right: 0px; bottom: 0px; width: 100%; height: 100%; background-color: Transparent; cursor: help; z-index: 1; } The div is placed right under the tag.. and under ther...

Href and onclick issue in anchor link...

I have anchor link with both href and onclick events specified. The onclick sets location.href to server url and href to a other link. When the link is clicked the href event gets called always but onclick event gets called only once (that is only for one anchor link). If i debug javascript it works properly that it calls both href an...

Javascript Server-side Events

I'm looking for the fastest way for multiple users on different machines to interact, and I think it's by using the server as the communication facilitator. So user A and user B both create a socket connection to the server of some kind and whenever user A does something it sends a message to the server, which then sends a message to use...

Removing <link> element with jQuery?

Hello, I don't want to use styles from style.css, so I decided to remove style.css from DOM. This work just fine in Firefox and IE8, but not in IE6: $("LINK[href='http://www.example.com/style.css']").remove(); Any other solution, with jQuery? Here is example: HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...

Javascript protection

Hello, I know this is kind of stupid, but I need to protect a javascript, in a sense that I wish to add as much security as possible so that it is not pirated. Well, because it the core component of the system. I plan to use YUI compressor to compress and obfuscate it. But I would also like to add a protection which checks the domain,...

Javascript XML Comment Documentation

I'm building a custom library of composite controls that include their own javascript files as web resources. I've got DocProject running to generate my XML documentation CHMs and it's working great. However, when I set my solution to "Release" configuration, the runtime is still not extracting the XML comments from the embedded javasc...

Jquery append() isn't working.

I have this <ul> <ul id="select_opts" class="bullet-list" style="margin-left:15px;"></ul> This javascript code which is meant to go throug a JSON object and add the options to the UL: $.each(q.opts, function(i,o) { var str=''; str+="<li id='li_" + i + "'><input type='text' id='opt_" + i + "' value='" ...

Is JavaScript an untyped language?

Hi I've found that some people call JavaScript a "dynamically, weakly typed" language, but some even say "untyped"? Which is it really? ...

table pagination and filtering with javascript and php

Hello, Let's say that you have to generate and display a table after querying a database using PHP. The table might have a lot of rows. One must be able to filter the resulting table using different criteria (single or multiple selections), much like an Excel table. example: +----------------------------------------------------------...

jQuery iFrame manipulation

I'm facing a problem while working with iFrames. What I need to do is, get the contents of a division 'contents' , display it in an iframe, and then remove all forms/form elements ONLY in that iframe. When i use $("#form").remove(), it removes the form both in iframe and in the window. Can someone help? Thank You. ...

Jquery .Click applies to all sub divs?

HTML: <div id="lowerLayer"> <div id="positionLayer"> <div id="imageLayer"> <div id="imageHolder" style="background-image: url('/Images/Loading/ajax-loader.gif');"> </div> </div> </div> </div> CSS: #lowerLayer { position: fixed; top: 0px; left: 0px; right: 0px; botto...

Is it possible to cache a whole website including start html page and startup with no internet connection?

Our website is an AJAX website that makes no page requests after the initial start up of our website. Information is communicated with the server through XMLHttpRequests. Our website allows users to work online and offline without a connection during a user session. When a connection is detected our website "synchronizes" with the s...

How to detect left click anywhere on the document using jQuery?

I have this right now: $(document).click(function(e) { alert('clicked'); }); In Firefox, this event is firing when I left-click OR right-click. I only want it to fire when I left-click. Does attaching a click handler to the document work differently than attaching it to other elements? For other elements, it only seems to fire on lef...

Is having multiple onmouseup event handlers valid html?

I'm refatoring some html in a JSP and I've noticed that the code has multiple onmouseup attributes for a button. Is this valid html, it seems to work, but is it valid? ...

Using jquery to create overlay but content inherits CSS opacity- can you help?

Hi there, I created a sort of modal overlay and then a content with the overlay.. the modal overlay has opacity set and it works but the content of the overlay also has opacity.. i think its inheriting it... I don't really want to apply a new class to the content, is there a way to say only apply to here is my css .modal-overlay { ...

Javascript: multiple events firing from single action

I have an onclick event attached to a region in my page that causes a certain action to fire when the user clicks in it (naturally). I recently added an image to that region. When the user clicks on that image, I want another action to occur, and I do NOT want the action associated with the entire region to occur. However, I find that bo...

jquery: Can you spell out how this position works? newbie to position using offsets etc.

Hi, Tracing this jquery autocomplete function, can someone explain in detail what is going on here? function showResults() { // get the position of the input field right now (in case the DOM is shifted) var pos = findPos(input); // either use the specified width, or autocalculate based on form element var iWidth = (options.width > ...

What causes Internet Explorers icon to flicker?

When I browse to my website, when the JavaScript loads, it takes a while. During that time, the Internet Explorer icon goes wild. It keeps flickering between the blue (loading icon) and the cursor. What am I doing wrong? This happens a lot. Especially when I try to type text within a textarea. ...

In what ways is JavaScript restricted when making a Facebook app?

I've been asked to do Facebook apps. Before I commit to anything, I want to know how easily a game can be moved to Facebook? (I'm completely comfortable making games in JavaScript in the browser.) Does Facebook filter the JavaScript in some way? Can I use jQuery or other JS libraries? Can I do animation by altering the DOM on the fly? ...