javascript

How can I get Visual Studio 2005 to show my running JavaScript files in the Script Explorer?

In the question Why will Visual Studio 2005 not debug my javascript? I learned that debugging is possible in Visual Studio 2005 but you have to start debugging your application and then press CTRL-ALT-N to open the Script Explorer to set break points, etc. However, even with the following simple code, when I press CTRL-ALT-N, the Scrip...

jQuery/javascript object passing

Up until this point, I haven't done much in javascript. I recently started playing with jQuery and came across a tutorial on how to do Edit in Place on a form. The resulting code works perfectly if you hard-code the id of your container div in the function, but I'm having issues generalizing it for an id passed in to the function. The...

Error in Safari 4 Beta and Chrome 2

I have popup window that is opened through a button click. If the user searches for a particular item in the child window, I attempt to switch the parent windows location by using window.opener.location in the child window. The parent window will always stay within the same website. This works fine in FireFox 3.07 & 3.1 b3, and IE 7&8...

Why would javascript click-areas not be working in IE8?

I'm trying to find a bug in an old ASP.NET application which causes IE8 to not be able to click on the following "button" area in our application: <td width="150px" class="ctl00_CP1_UiCommandManager1i toolBarItem" valign="middle" onmouseout="onMouseOverCommand(this,1,'ctl00_CP1_UiCommandManager1',0,0);" onmouseo...

IE6 Text Resize in JavaScript Modal

I am having an issue where IE6 will not re-size the text in a JavaScript generated modal window. If I leave the parent page text size at medium open the modal window and then re-size the the text to largest, the text becomes cut off in the modal window. If I close the modal window and leave the text size at largest, then re-open the moda...

Why don't visual studio javascript breakpoints work in firebug?

Why can't microsoft make setting a breakpoint in visual studio equivalent to adding the "debugger" keyword in javascript? I want to test javascript cross browser in a unified way. ...

toggle div visibility with a checkbox list

Hi, I have a web application(ASP.NET2.0 C#). Within it, I have a div that contains a checkbox list and a button. I want to toggle the div viewing, so I got some javascript code online to help me. Heres the code: <script language="javascript"> var state = 'hidden'; function showhide(layer_ref) { if (state == 'visible') { ...

Javascript/ajax/php question: sending from server to client works, sending from client to server fails.

Hey All, Sorry for reposting(Admins, please delete the other one!). since you guys have been a great help, I was kinda hoping that you could help me once again while having the following question: I am currently trying to work with AJAX by allowing a managerclass in PHP to communicate via an XmlHttpobject with the javascript on the clie...

Silverlight 2 - Download file - IE Blocks file download

Hi All, I'm having a problem with IE only in my Silverlight application. Since Silverlight 2 doesn't include a mechanism for file downloads I was left to my own devices to come up with a solution. The way I did it was as follows: HtmlPage.Window.Navigate(new Uri(sb.ToString(), UriKind.Relative)); My StringBuilder contains the relative ...

Onleftclick & onrightClick javascript functions????

In my server side code I am dynamically building a table and and right now I am adding the following code to handle the row click. tr.Attributes.Add("onclick", "window.open('" + root + document.IPT_Name + "/" + document.IPT_Sub_Name + "/" + document.File_Name + "', 'mywindow', 'toolbar=no,location=no,directories=no,status=no,menubar=yes...

Make an option selected based on $_GET. Is this even possible?

Hi, I have a quick question. Is it possible to do something like this? The options are generated dynamically based on foreach loop. I want the loop to stop where the $_GET['t'] equals the $k and make it selected. <option value="http://domain.com/&lt;?php print $k; ?>/" <?php if ($k == $_GET['t']) print 'selected'; ?>><?php print $v; ...

Boolean HTML Attributes

There are some attributes in HTML which are "boolean" - browsers treat them as "true" if they are present, regardless of the value. An example of such an attribute is selected on the <option> tag. Another is checked on <input type="checkbox">. If you have a call to setAttribute() for such an attribute, there seems to be no value you can...

How do I copy input from one textbox to another via checkbox using jQuery?

I'm cleaning up a simple form that has a Start Date textbox and an End Date textbox. I want to add a checkbox in between these fields that the user can check if the End Date is the same as the Start Date, so when they check it, the Start Date input value (e.g., 04/01/09) will automagically appear in the End Date textbox, so they don't ha...

Javascript class variable scope using prototype

Hi I'm writing a basic class using prototype.js in which some class vars are set when the class is initialised - the problem is that these variables aren't available to other methods within the class. var Session = Class.create({ initialize: function(){ // define defaults this.source = ''; }, shout: function(){ alert(this.source); }...

Using JavaScript to change the URL used when a page is bookmarked...

JavaScript doesn't allow you to update window.location without triggering a reload. While I agree with this policy in principle (it shouldn't be possible to visit my website and have JavaScript change the location bar to read www.yourbankingsite.com,) I believe that it should be possible to change www.foo.org/index to www.foo.org/help. ...

Send additional data with autocomplete options

I have a field that autocompletes on person name, so it has options like "Obama, Barack", "Lincoln, Abe", etc. These people also have additional attributes, say "Birthplace" and "Phone number". When a user picks an option from the autocomplete, I would like that person's additional attributes to automatically populate hidden form fields...

ASP.NET enter key and form submit with no javascript

I have a form that I want to submit when the user presses the enter key. It works fine in Firefox, but not in IE. It is basically the same issue as this, except that I am not allowed to use any JavaScript: http://stackoverflow.com/questions/270494/enter-button-does-not-submit-form-ie-only-asp-net Unfortunately it looks like ASP.NET uses...

Stop music from in flash from javascript event

I am attempting to stop the music inside of my flash swf that I have loaded in the page <object id="FlashControl1" type="application/x-shockwave-flash" data="Flash/Preloader%20-%20Splash.swf" width="980px" height="316px"> <param name="movie" value="Flash/Preloader%20-%20Splash.swf" /> <param name="wmode" value="Transparent" /> <param na...

jQuery hierarchy issue with next()

Seems like $("img").next().hide(); is not working when both the image and div tag are a child of a paragraph. <p> <img src="image.jpg" /> <div>text</div> // this div is set to 'display: none' by default in css </p> Yet, if I substitute <div> with <span> <p> <img src="image.jpg" /> <span>text</span> </p> or if I omit the <p> tags <...

Get form elements by name?

I would like to style all of the radio buttons with the same name in a form easily in a nice Prototype or jQuery-style shortcut. $('billship').select('name:shipType') or something like that. Does such a shortcut for form field names exist? ...