javascript

Javascript confirmation dialog - ASP.NET

I saw a couple of similar questions on the same topic, but none of them addressed my issue. I've got a asp.net website, and want to show a status message (asp:label that will disappear in 5 seconds) to the user after the database was updated. i want to assign the text to the label, and then hide it with javascript. i got the js part ...

null / empty json how to check for it and not output?

I've got a json encoded dataset that I retrieve via ajax. Some of the data points I'm trying to retrieve will come back us null or empty. However, I don't want those null or empty to be displayed to the end user, or passed on to other functions. What I'm doing now is checking for if(this.cityState!='null'){ // do so...

Putting javascript id inside div with jQuery

$('div.box').html("hello") puts the word hello inside all my div's of class 'box'. They all have an assigned id. I'm trying to figure out how to put each div's id instead of 'hello' inside the div. Maybe this is really easy, but I can't figure it out. I'm also new to jQuery. Any ideas? I've tried: $("div.box").html("id: " + $(th...

How should one start learning web applications development?

I have done web programming through PHP, so I know the basics of HTML, CSS, and sessions. Nontheless, there's probably a lot of concepts and theory behind web development which I'm probably missing since my original approach came from knowing a language, not a platform itself. Where does one go to learn the practices and general theory,...

Javascript and MySQL

I want to build an entire web app using only Javascript and MYSQL . Anyone know how I can go about this if it's possible. Thank you. p ...

open file select dialog with javascript

I have hidden input type=file field, and i want to open its select dialog with javascript. I tried to fire click event on this element, but without luck. Im using mootools. $('input_id').fireEvent('click'); This is possible at all? ...

displaying a javascript-generated div in IE7

The following code shows what I expect in Firefox and Chrome: a small white square in a big green rectangle. I don't see the small square in IE7. How can I make it appear? <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> <meta http-equiv="Content-Type" content="text/...

Resize iframe height according to content height in it

Hi all, I am opening my blog page in my website, problem is i can give width to iframe but height should be dynamic so that there is no scroll bar in iframe and it looks like a single page... i have tried various javascripts to calculate height of content but all of them gives access denied permission and of no use. my question is c...

Is there a way to pass a value TO GM_xmlhttprequest?

As indicated here: http://stackoverflow.com/questions/525243/how-can-i-return-a-value-from-gmxmlhttprequest I have a script that is asynchronous. I would like to pass a value INTO this function so that when the onload function is called I can use it to display in the web page. The challenge I'm having is that this value will change e...

Freeing memory used by unattached DOM nodes in Javascript

As part of my application, I'm putting together a set of small Dom nodes that are not shown all at once. I'm storing them in an internal array. The user can invoke their display in which case I reparent them to the div that is used to display them. That's all well and good. But when it's time to replace all of them with new ones, I wa...

CSS / JavaScript - How do you get the rendered height of an element?

How do you get the rendered height of an element? Lets say you have a <div> element with some content inside. This content inside is going to stretch the height of the <div>. How do you get the "rendered" height when you haven't explicitly set the height. Obviously, I tried: var h = document.getElementById('someDiv').style.height; ...

Statistics or resources: which gets disabled first (more often than others)? Images or Javascript?

I am creating a new website and this question came up, statistically, including all browsers (phone browsers as well), which gets disabled more often? Images, Javascript, or CSS? Reason Im looking for an answer is to design the image-replacement technique that covers the most recurrung scenarios. ...

jQuery - Compatibility Problem with Internet Explorer 7??

Hi, I have this code that dynamically slides up a Div over an image when mouse over it. It works perfectly in Firefox and Google Chrome, but in Internet Explorer 7 everything runs really slow and nothing happen. The jquery code is this: jQuery.fn.masque = function(class) { $(this).hover(function(){ $(this).find(class).stop().animate...

How do I create methods for an HTML element?

Hi, I'm trying to create a simple, small and basic javascript framework just for learning purposes. But the thing is that i'm allready stuck at the very basics. I'm trying to do something like this: $('testdiv').testFunction(); And the code i've written for that: var elementID; var smallFramework = { $:function(id) { this.el...

Testing if something is a class in javascript

Hey all, I am trying to test if the argument passed into my function is a class name so that I may compare it to other classes using instanceof. For example: function foo(class1, class2) { // Test to see if the parameter is a class. if(class1 is a class) { //do some kind of class comparison. if(class2 is a class) { ...

Resource.axd files - Why so many and why so big?

ASP.NET - I've managed to siginificantly reduce the number of .axd requests a page of mine is making by using the ajax ToolkitScriptManager control. My question now is, why on earth is there SO MUCH JavaScript in those .axd files? I'm talking approx. ~1MB (un-gzipped) just to use a few Ajax controls on a page! Is there anyway to make t...

How to Implement Closures Using SpiderMonkey API?

I've been working with the SpiderMonkey C API and would like to implement a closure in C using their API. The one I would like to implement is fairly complex, but I can't even figure out how to do a simple one such as: function x() { var i = 0; return function() { i++; print(i); }; } var y = x(); y(); //1 y(); //2 y(); //3 I w...

If a <li> is clicked, hide the inner div

Hi, My DOM looks like this: <li id="li1"> <div class="c1"></div> </li> <li id="li2"> <div class="c1"></div> </li> Using jQuery, if the first is clicked, I want the inner to be hidden. ...

jQuery Manual Resizable DIV

Hi, I'm trying to create a resizable div without using jQuery's interface library. var myY = 0; var mouseDown = false; var originalHeight = 0; function resize(e){ if(mouseDown == true){ $("#cooldiv").height(originalHeight+e.pageY-myY); } } $(document).ready(function(){ $().mouseup(function(e){ myY = 0; mouseDown = ...

DHTML menu not displaying

I am trying to display the menu using DHTML but I am getting a Javascript error and menus are not getting displayed. <script language="JavaScript" vqp_datafile0="Welcome to Epicenter Fitness_files/epicenter_nav.js" vqp_uid0="61625" vqptag="doc_level_settings"> cdd__codebase = "Welcome to Epicenter Fitness_files/...