javascript

Displaying two dynamically added elements in different rows

I've an HTML page like following: <html> <body> <div id="emaildiv" class="main" style="width:150px;height:80px;"></div> </body> </html> I want to add a DIV with a TEXT and BUTTON in to it dynamically. All these are made by using the following javascript. function newEmailForContact() { var parentDiv = document.ge...

How to create dropdown list with "new value" option ?

I would like to create a dropdown list where the last option will be to enter a new value. How could I create this ? Is there any jQuery plugin that provides such thing ? ...

Submitting forms and using the value (JavaScript)

How do you use a value "submitted" by a form in javascript? Facts: It is a PHP document I'm using JavaScript because I need some timing factors I don't think I can get from serverside-scripts :) To simplify; what I want is, that when this form is submitted or a button is clicked: <form method="POST" action="test.php"> <input type="...

Who can implement inflate in C# for dankogai's javascript deflate?

this is dankogai's javascript deflate http://github.com/dankogai/js-deflate I can't inflate from c#,please help me ...

How to reference multiple files for javascript IntelliSense in VS2010

Hi. I have large solution with about 40 separate javascript files, which are referenced to web page via special js-service. I want to use new IntelliSense features in VS2010, but it is very hard to add about 40 individual references like this: /// <reference path="../../lib/jquery-1.3.2.js" /> to each js file in solution. Maybe there...

javascript: Using the current for-loop counter-value inside a function() { }?

Hi, on a website i want to do this: (simplified) myHandlers = new Array(); for(var i = 0; i < 7; i++) { myHandlers.push(new Handler({ handlerName: 'myHandler'+i, // works, e.g. ->myHandler1, 2, 3 etc. handlerFunc: function(bla) { /*...*/ alert(i); } // doesn't work,all return 7 } } I could set the counter as another attrib...

url in window.open is not working in IE.

UPDATED I have a page where i upload an image to crop which opens a window with the required functionality, it works absolutely fine as per below given script, but it doesn't work with IE <script> window.open('http://mymachine/mysite/crop.php?bgimagecode1=1281439586.jpg&amp;x=728&amp;y=364&amp;id=30&amp;bannersize=1x2&amp;osCsid=','myw...

Skype Phone Number Recognition

on browser phone number are showing with skype icon , I dont want that skype icon in hone number, I want to remove , is is possible through script.. I dont want to show skype icon any where , any system , is there any javascript or php function there.. Thanks ...

Website script injection scan

Does anyone know of any script injection scanners that are able to detect if your website has been compromised (i.e. javascript that has been injected that should just not be there)? Update: found what I was looking for - http://sucuri.net/ ...

JavaScript sample code

Please see the site: http://www.ibsolution.de/irj/portal//dsag_2010 On the page there's a tab section, where you can click any of the following tabs: Info Anmeldung Unsere Vorträge Unsere Partners Is this created using JavaScript? I also want integrate something like this on my website. What do you call this? ...

Jquery: Why will this if-else statement only follow the if, or the else, but wont follow both when they're different conditions that can be met..

Question: Why wont the If and the Else both work, when both conditions can be met at different times by scrolling below or above '.fakeheading'? Is the Else-statement overpowering the If-statement? JQUERY: $(window).scrollTop(function() { $('.grid_12').find(function () { var $header = $(this); if ($header.off...

Maintain horizontal and vertical ScrollPosition on Postback in ASP.NET

Hi Guys, The coding is in ASP.NET C#. I have a gridview, with say 1000 records and I am inline editing one of the rows. On Clicking Update, I would like my Grid to be on the exact x y position it was on before the postback happened. If you are thinking along the lines of using the Page directive, MaintainScrollPositionOnPostback="true...

store return json value in input hidden field

Hi all, I was wondering if it's possible to store the return json in a hidden input field. For example this is what my json return: [{"id":"15aea3fa","firstname":"John","lastname":"Doe"}] I would like to just store the id in a hidden field so I can reference it later to do something with it. ex: I have something like this... ... and...

How do I programatically click on a bookmarklet that opens a Javascript window and verify the window's contents?

I want to open a specific URL(relatively easy to achieve in Watir/WatiN), then click on a bookmark/bookmarklet which in turn opens a Javascript window in which certain links then appear. I want to be able to verify links' wording and URLs. The "problem" is having to use IE (7 & 8) and not Firefox which prevents me from using Selenium ID...

Jquery getScript($.getScript()) not working on chrome?

Hello Guys, I have a problem using $.getScript() on chrome. It doesn't work on chrome browser. I've tested it on firefox, ie and safari and it worked. All I have on my external script is an "alert()" and it doesn't work. Here's the code: page $(document).ready(function(){ $("#btnGet").click(function(){ $.getScript("script.js"); ...

Learning jQuery: if & else statements, is this valid?

At the moment I'm learning jQuery and I hit the topic about if/else statements. As I have no background in programming this topic is something that I need to practice a bit more to get a thorough understanding of it. The book I'm studying gave me the advice of just writing different blocks of if/else statements. I just had an idea and ...

div tag to show on expand and hide on collapse usi ng xslt

hi I have list of hyperlinks on a webpart and i would like to show a plus sign next to each link and when i click on it should expand and would like to show the description and when i click on the -ve sign it should collapse and description should be hidden. How can i acheive this using xslt. Plz privide me some suggestions. Let me know...

how to compare xmlhttp.responsetext?

my code- document.getElementById("lblmsg").innerHTML=xmlhttp.responseText; if(xmlhttp.responseText == 'Available') { document.getElementById("newid").value = ""; } although response text is Available but still it is not going inside if condition??...

Breaking loop from outside the loop.

I have a search form with default values. As the user loades the page, onload I call a function. This function has a loop, which calls a Ajax Request with each iteration. I take about 20 to 30 Seconds will all the Ajax Request are executed. During these Iteration user can change form values and can Submit the form before these iterati...

Selecting parent/ancestor node based on value in child node.

Hello, My company makes a publication which outputs a clients current set of diagrams, You can search the publication for diagrams with a given attribute value. This works but only if the value is contained in the first Attribute node. Me and another fellow have been trying to fix it so that it searches all the attributes. Here is th...