javascript

inner span is not getting ref in jQuery.Why?

Dear All, I have one html structure: enter code here <ul> <li><span>aaa</span> <div> <ul> <li><span>bbb</span> </li> </ul> </div> </li> <li><span>ccc</span> <div> <ul> <li><span>ddd</span> </li> </ul> </div> </...

JavaScript garbage collection when variable goes out of scope

Does JavaScript support garbage collection? For example, if I use: function sayHello (name){ var myName = name; alert(myName); } do I need to use "delete" to delete the myName variable or I just ignore it? ...

Javascript in Mobileweb in ASP.NET

Is it possible to use javascript in Mobile .NET, if yes please let me know how we can do that. Please post Link to the helping article for javascript in Mobile .NET if you know some. ...

JS Calendar Outlook control

Hello can you share your experience about javascript outlook calendar like control I have to add such a control to one project but don't have any experience at the moment 10x in advance ...

[PHP/JavaScript]: Get PHP session value in other file's JavaScript function.

I have a PHP file and it holds a value in this session variable: $_SESSION['image_value']. I want this session value in a JavaScript function. Actually, I want to match a string in my JavaScript function with this session value. Anyway I can do this? ...

Changing the address of the opener window in IE8

From a child popup window (opened using window.open), I am trying to change the URL of the window that opened me, e.g. window.opener.location.href = 'http://www.google.com'; In all browsers this works wonderfully, except for IE8 (and I am somewhat sure it worked in previous IE8. Maybe a security update kills this). In IE8 what happens...

Understand (via javascript) if the current page is reached using browser's history

As the title: there is a way in wich I can know, client side, if the current page is shown by navigating the browser's history, or following a link, or by a postback? ...

add remove <li with textbox on button click. (out of ul wrap problem) and name inputs uniquely

Hi friends, I have an issue with js. I have form like below. Add button is adding li with input box and Remove button is removing... it is working very well. the issue is, it is creating the li after ul, out of ul :/ you can see it clearly at the screenshot below. any idea about solution? appreciate!!! thanks!!! * ps, how can I nam...

how can i get values from multiple forms and submit them?

I have several forms inside DIVS on my page. I have one form which contains a text field and is always visible, and this is where the user hits 'enter' key and submits... I want to get values selected in the other forms on the page, and submit them all together, not one by one, so that my PHP code can use "ALL VALUES" and search a mysq...

Using JavaScript to return search results from Twitter

Hey there! I have a question about using Javacript to return search results from twitter. The idea is to use arrays, but we have not really covered them in class. Can anyone suggest how I might get started writing these functions? Below is the template we are supposed to use: /* This function takes an array of "tweets" and conve...

Can a child iframe onload event trigger a url updation (window.location.hash ) on the parent window(browser) and still keep back button functionality on browsers.‏

The question is on iframes/bookmarkablity and back button functionality. This issue I am facing is how to create iframes with bookmarkable url's without loosing the back button functionality.Lets say all the pages are in the same domain and the child pages inform parent of the child page load for updating the window.location.hash pro...

What are the reasons to use the id attribute for CSS purposes?

I've always used the class attribute, never id for the purpose of CSS selecting and styling. I know that the id must be unique, but that doesn't seem to be a reason to use it for CSS. The only reason I have used the id attribute is for JavaScript and form labelling. I find mixing id and class for the purpose of CSS can cause confusion,...

Is it possible to stop the browser from following the link when the onclick of the child element fires?

This is what I have basically: <a href="http://somelink.com"&gt; <span>stuff</span> <span onclick="AwesomeFunction();">more stuff</span> <span>the last stuff</span> </a> Now, the problem is I want to keep the parent as a link but if the user clicks the span with the onclick event I don't want the browser to follow the link...

check box enable in Jquery

<tr id="tr99"><td>......</td></tr> <input type="checkbox" onclick="toggletr(this);" value="val" id="cbox" /> The javascript: $(document).ready(function() { function toggletr(obj) { if(obj.checked) $(#tr99).hide(); else $(#tr99).show(); } hi.this is my code that runs in add page of staff. if user is ...

Practicality of compiling another language to Javascript?

Recently several tools have been released such as pyjamas and Scheme2js that allow one to take code in a language such as Python or Scheme and compile it to Javascript. But how practical is such a tool? I could see debugging being quite painful as you would have to debug the compiled javascript code itself, and correlate any bugs in ...

Is JavaScript's Date object susceptible to the Y2038 problem?

Assuming a 32-bit OS/Browser, could a Date object created in JavaScript rollover to 1970 if I set a date beyond 2038? The Mozilla documentation says a year can be set to 9999, however I don't know if this is consistent across all JavaScript implementations, or if this is an accurate description of what the specification dictates. I wou...

jQuery Autocomplete Problem - Not treating Arrays correctly.

I am using jQuery Autocomplete and MVC to populate a dropdownlist with a bunch of column names. Whenever a user changes the value of a DropDownBox on my form I make a request to my controller to return a new list of columns (as an array, wrapped in a JSON Result) that will populate my AutoComplete boxes. My Problem is that the autoco...

Can I use a static (i.e., predetermined) callback function name when requesting JSONP with jQuery?

The jQuery documentation lists the following example of using $.getJSON to request JSONP: $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&amp;tagmode=any&amp;format=json&amp;jsoncallback=?", function(data) { $.each(data.items, function(i,item) { $("<img/>").attr("src", item.media.m).appendTo("#imag...

Prevent redirection when form is submitted programmatically

Hello I've got a form on the html page which gets submitted by javascript in some cases. The problem is that browser window change its location to the action URL specified for this form. Is there any way to prevent it of working this way? ...

capture mouse position on setInterval() in Javascript

I have a function in javascript that moves one div depending on the mouse position. This function is set on a setInterval() function and executed every second. I need to capture the mouse position like this: function mousemov() { document.getElementById("myDiv").style.left = Event.clientX; //don't work } window.onload = function() { ...