javascript

Incomplete JS script tag with RegisterClientScriptBlock

I'm currently trying to register a JS function call from a .NET page which simply calls a small function on the .aspx page that will close the window. The RegisterClientScriptBlock code is like this: Page.ClientScript.RegisterClientScriptBlock (typeof(Page), "closeBox", "<script type='text/javascript'>closeBox();</script>"); This sor...

How to set the row id [ TR ] and column id [ TD] in displaytag?

I am using Displaytag to display the DataGrid. Now, I have to change the color of rows based on some calculation. Like if the value of column3 + column4 > coulmn5 then the row color should be yellow value of column3 + column4 < coulmn5 then the row color should be red value of column3 + column4 = coulmn5 then the row color should be ...

jqgrid not executing when bound to click event

I'm not sure why this isn't working but probably because I'm not very familiar with javascript. The following is initialised $('#categoryList').find('.sideboxEntry').live("click", function() { productBindToGrid(); }); productBindToGrid(); function productBindToGrid(filterBy) { $("#productGridView").jqGrid(); } productBindToG...

Disable F5 key in Safari 4

I have written the following javascript code to catch F5 key press and prevent the user from refreshing: (I understand this is not a good idea but i am stuck with this whether any one likes it or not. Also the question i ask pertains to why the script below does not work with safari 4 but works for other browsers.) var fn = function (e...

How to syncronise two browsers

I have a little problem and because my WEB development skills are not the sharpest I hope you can help me. The problem is that I am working on a digital SCRUM task board and one of the core functionality would be that browsers having the same project taskboard open would have to show the same picture. So that if person A moves a task pe...

How does jQuery store xml used as a context parameter as it modifies it?

I'm trying to reduce DOM manipulation during my javascript execution, and I thought about lazy-writing DOM elements, versus writing a large section of the DOM hidden and unhiding the needed parts later. To do this, I've separated out all my DOM content into a JSP which I load into a variable via ajax and manipulate with jQuery. However,...

Retrieving cookies

I was wondering how I could retrieve a cookie that has a path specified - something like path=/foo/bar... If I use document.cookie that only retrieves me JSessionId cookie.. which I guess is the only one with path=/. ...

How do you align or hide background images in a javascript slideshow?

I've created a slideshow on a website (sorry, new user and can only post one link) using this method: http://iamacamera.org/sandbox/linkedphotoshuffler/ I only changed the specified variables, and it works great, except that about 10 or so pixels of the right edge of the image currently in the background are showing. I've checked, and th...

How to get javascript to run after AJAX calls

Okay, a little preface: I am still a beginner when it comes to AJAX, and dynamic web stuff. My problem is similar to what was asked in the following, but I think that discussion is using a framework, and I am not. Potentially related post Here is my scenario: I have several select elements in a form. The initial select's option elemen...

Is "localStorage" in Firefox only working when the page is online?

So i'm toying around with HTML 5 and the localStorage and i'm noticing that my values only get stored when i run the page in Firefox on the local host (i.e. http://127.0.0.1:8000/test/index.html) when i run the file locally (file:///C:/test/index.html) my values won't get stored. Safari 4 has no problems with both setups. So does anybody...

Trigger javascript event when using Google auto fill on firefox

Hi all, I have a form, in which I am disabling the submit button until an user has typed in all the mandatory fields. I was initially using onkeyup to keep a tab on the mandatory fields and enable the button when all the mandatory fields are filled. But I had users complaining that they filled in the form using AutoFill button on the G...

jQuery and IE7 layer problems

When using jQuery with internet explorer 7, i cannot get it to display a popup page, the screen goes grey, the popup is there but not highlighted. I have not modified any of the code, so i know i have not messed it up anywhere. When i run the page using safari or mozilla, everything is ok, even ie8 display's the page, but ie7 is givi...

Javascript - return string between square brackets

I need to return just the text contained within square brackets in a string. I have the following regex, but this also returns the square brackets: var matched = mystring.match("\\[.*]"); A string will only ever contain one set of square brackets, e.g.: Some text with [some important info] I want matched to contain 'some important ...

Upload File Validation using jQuery Forms in ASP.NET MVC

Hi, I am working on some ASP.NET MVC code which makes use of the jQuery Forms plug-in to allow users to upload files. The Form: <% using (Html.BeginForm("SaveAttachments", "Data", FormMethod.Post, new { enctype = "multipart/form-data", id="SaveAttachments" })) {%> <input type="file" name="consentform" size=30/> <input ...

Google Visualization Motion Chart Undefined?

Good Morning all! I'm running into an issue this morning where I added a Google Visualization Motion Chart to my application. But like most things its not cross browser compliant. In FF3 it works fine but in Safari and IE 7 the error console says: "TypeError: Result of expression 'google.visualization' [undefined] is not an object."...

jQuery popup not working in IE7

I'm using the following to create a popup layer so user can enter information : /* * Guidelines to use this js file * 1. do not change function doBubblePopUp * 2. add specific task for your module in doModuleSpecificTask * 3. write appropriate module function defined in 2 * 4. for form submission use document ready for submit, chec...

jQuery Plugin Authoring: Cannot get basic example to work?

Hi all, I'm trying to write a few plugins for jQuery, so as a starting point I went for the basic example shown in the documentation (here). This is the code I have, in a js file called jquery.test.js: (function($) { $.fn.myPlugin = function(settings) { var config = {'foo': 'bar'}; if (settings) $.extend(config, settings...

Microsoft's AJAX Toolkit vs. jQuery

Our team has been using Microsoft's AJAX Toolkit since the days of Atlas. In a bit of naivety we missed the jQuery/Prototype phenomenon until a month or two back. Until now, we have always associated the concept of Ajax with Microsoft's toolkit. In reading up on jQuery I'm seeing a whole new side of Ajax that I was only vaguely aware ...

jQuery : Append text after an input field

I have a simple input field : <input type="text" id="someid" name="somename" class="someclass"> I'm trying to append some link right after this; so i'll get : <input type="text" id="someid" name="somename" class="someclass"> - <a href="#">..</a> i tried : $("input#someid.someclass").append(' - <a href="#">Are you sure ?</a>'); ...

How to call bat file present inside firefox extension content directory ..

I have a bat file which needs to be called from javascript in firefox extension .. I have bat file present in content/chrome directory.. I tried to call bat file like this .. var exe = Components.classes['@mozilla.org/file/local;1'] .createInstance(Components.interfaces.nsILocalFile); exe.initWithPath("chrome://sample/co...