javascript

javascript regex: match altered version of first match with only one expression

Hi there I'm writing a brush for Alex Gorbatchev's Syntax Highlighter to get highlighting for Smalltalk code. Now, consider the following Smalltalk code: aCollection do: [ :each | each shout ] I want to find the block argument ":each" and then match "each" every time it occurrs afterwards (for simplicity, let's say every occurrence a...

Clarification/explanation of RegisterClientScriptInclude method

I've been looking on the Internet for a fairly clear explanation of the different methods of registering javascript in an asp.net application. I think I have a basic understating of the difference between registerStartupScript and registerClientScriptBlock (the main difference being where in the form the script is inserted). I'm not s...

A "never seen before" javascript error (Access to property denied" code: "1010)

I was testing my jqgrid and when I was attempting to add details through jqgrid's modal window I came across the following error in my firebug console. Access to property denied" code: "1010 checkValues("2010-04-20", 5, table#list.ui-jqgrid-btable)grid.common.js (line 441) postIt()grid.formedit.js (line 794) anonymous(Object originalEve...

How to get option value (javascript)

Below are the options that i have in my code <label id="subn"> <select name="subs" id="subs"> <option value="nothing">Choose a Subject</option> <option value="General Question">General Question</option> <option value="MemberShip Area">MemberShip Area</option> <option value="Others">Others</option> ...

jQuery unbinding click event when maximum number of children are displayed

I have a personal details form that alows you to enter a certain number of dependants which is determined by the JSP application. The first dependant is visible and the user has the option to add dependants up to the maximum number. All other dependants are hidden by default and are displayed when a user clicks the 'Add another dependa...

calling a java webservice from html page and javascript

Hey guys, I'm trying to call a java implemented web service (using the NetBeans IDE) from javascript. I have read a lot about jQuery and AJAX but i cant seem to get a hand on it. suppose my web service WSDL is found at: http://localhost:8080/MICE_Server/MapEditorService?WSDL web method name : sayHello(String name) which returns a stri...

Get variable value from XML to JavaScript. Pure way.

I have XML: <point> ... <longitude>34.123123</longitude> </point> <point> ... <longitude>11.12534534</longitude> </point> <point> ... <longitude>32.567653</longitude> </point> <point> ... <longitude>33.345345</longitude> </point> ... Task: get values of <longitude> in javascript (in variable). Whic...

Javascript cookie

Hi, I have created javascript cookie for storing the last visited pages(3) URL in sharepoint .It is working correctly at any .NET website and creating one cookie text (cookie) file at C:\Documents and Settings[user-name]\Cookies .But for sharepoint portal the links are sites and different pages.It is craeting different cookie (text) fil...

Are there any GOOD javascript addins for Visual Studio?

In our daily work we maintain some rather large Javascript libaries. We use VS2008 and while they made some improvements to the Javascript IDE, I still find it lacking. There is no outlining, no collapsing, or other ways to keep the code organized. I have tried js-addin and JSLint which crash and don't have the features I want, respecti...

Method that passes options to its object

In JavaScript I'd like to take an object and pass a parameter to it and based on the parameter have a method that will pass settings to the parameter: functionName( parameter , settings ); Or functionName( parameter ).methodName( settings ); example: for my iPhone web app setup I do heavy('setup',{ icon: 'icon.png' }); and I want t...

jQuery + InnovaStudio WYSIWYG Editor

I am trying to avoid hard-coding each instance of this WYSIWYG editor so I am using jQuery to create an each() loop based on function name. Annoyingly InnovaStudio seems to explode when I try. Documentation Attempt #1 <script type="text/javascript"> /* id = $(this).attr('id'); if(id.length == 0) ...

Is there a way to do this with basic JS DOM?

I need to apply/remove to an input field according to a user's selection in a separate drop down form - but I can't figure out how to target the input's class. I need to add/remove the 'pageRequired' class from this input: <input type="text" title="Company Required" name="customfields-tf-2-tf" class="inputclass pageRequired textInput...

How does exception hub works

Just wondering how does ExceptionHub http://www.exceptionhub.com/ track the javascript errors in the user's browser? ...

How do I stop the scriptaculous blind-down effect from flickering when element has padding?

Hi all, it seems that when the blind down effect is used on an element with padding it looks a bit awkward. It seems to blind down too far and then jumps back. It's a very subtle thing but is really annoying. I don't have an online example but if you go to the demo on github and give the element a padding-top or bottom with firebug or ...

Catching uncaught exceptions

Hi everybody. In my workplace we are mantaining a lot of ecommerce websites, some coded better than others. On some of those, sometimes uncaught exceptions are thrown, and showed by the alertbox from the flash player debug (If you have it installed). To rise the average user experience I'd like to report all those exceptions throught a ...

joining relative urls?

So i want to join strings with relative urls in Javascript. base url = "http://www.adress.com/more/evenmore" with relative url = "../../adress" => "http://www.adress.com/adress" relative url = "../adress" => "http://www.adress.com/more/adress" What would be the best way? I was thinking of using regexp and checking how many "../" i fi...

Referring to a specific place on page

I know that in Javascript document.location.href = "#my_id" tells the browser to display the same page starting from element with id="my_id". In this case, the address that appears in the address bar is in the following format: my_page_address#my_id Is this the only method to refer to a specific place on a page ? I'm looking for a metho...

Append some HTML into the HEAD tag?

Hi! I want to add some style to head tag in html page using javascript. var h = document.getElementsByTagName('head').item(0); h.innerHTML += '<style>a{font-size:100px;}</style>'; But when I run this code in IE8 I see this error message: Could not set the innerHTML property. Invalid target element for this operation. Any ideas? ...

Test whether image loaded correctly with JavaScript

I have an image deployed on several application servers (green up arrow: uparrow.gif). I have an application server status page where I list out all the servers and with a corresponding image where the image's source is the uparrow.gif for that server. If the image does not load (server down) I would like to switch to a red down arro...

How to set the dropdownlist value?

I am using this technique: http://stackoverflow.com/questions/2670327/is-there-a-way-to-hold-the-values-lost-in-postback After it does the postback, how do I set which item is selected? $(document).ready(function() { if (document.getElementById("txtHidData").value != "")<br> $("#country").val(document.getElementById("tx...