javascript

How do I call system code from JScript/VBScript?

I have a C# app that uses a web browser control to display some HTML and do some JScript in the background. How do I integrate this with other system calls? Do I call other C# code from JScript/VBScript? Do I need to do it from the form itself? ...

Jquery: Filter dropdown list as you type

I have used a prototype plugin which filters the contents of a dropdown as you type. So for example if you typed 'cat' into the text box, only items containing the substring 'cat' would be left as options in the drop down. Does anyone know of a jquery plugin which can do this? ...

textRange selection MSIE

Hi I can easily set the selection on 2+ elements programatically in Firefox But have had no success with IE so I hope anyone here can help me with this Thanks in advance, Mulberry ...

Versatile xml attribute regex with javascript

Basically I have an xml document and the only thing I know about the document is an attribute name. Given that information, I have to find out if that attribute name exists, and if it does exist I need to know the attribute value. for example: <xmlroot> <ping zipcode="94588" appincome = "1750" ssn="987654321" sourceid="XX9999" sourc...

javascript and php on the fly calendar

I have the code for a javascript calendar and it works perfectly as it creates it when the page loads. However I was wondering if it's possible to add events to it. I found a plugin (jQuery) that enables the user to hover over a td with class "event" and an event will be displayed. So since this calendar will not be used by me but by som...

How do you add CSS with Javascript?

How do you add CSS rules (eg strong { color: red }) by use of Javascript? ...

Apply jQuery datepicker to multiple instances

I've got a jQuery date picker control that works fine for once instance, but I'm not sure how to get it to work for multiple instances. <script type="text/javascript"> $(function() { $('#my_date').datepicker(); }); </script> <% Using Html.BeginForm()%> <% For Each item In Model.MyRecords%> <%=Html.TextBox("my_date")%> <...

How to fix this JQuery dropdown menu?

Hi Guys, I tried to create a dropdown menu in JQuery, but it's proving quite difficult. My code is here: $(document).ready(function(){ $('ul li').mouseover(function() { $(this).children("ul").show(); }); $('ul li ul').mouseover(function() { $('ul li ul').show(); ...

Javascript: Why compare with null?

An open source JavaScript project I work on includes code: if (color) { tapeDiv.style.backgroundColor = color; // set color here if defined by event. Else use css } A contributor wants to change it to if (color != null) { // this line changed tapeDiv.style.backgroundColor = color; // set color here if de...

Is there a JavaScript WYSIWYG that leverages jQuery?

I have looked at TinyMCE, FCKeditor, YUI Rich Text Editor, NicEdit and some others, but I was wondering if there is one out there that utilises jQuery? I mean, I already use jQuery in all my projects, and it seemed it'd be useful to have a WYSIWYG editor that used it also. This should result in a smaller file size. I understand if one d...

Why would I want to use jQuery?

(I understand that someone else asked a similar question and it was closed as 'argumentative', but I'm really interested in understanding the arguments around this.) I know JavaScript really well. I've been writing it professionally for years. I've internalized a lot of the cross-browser incompatibilities and sketchiness, know DOM manip...

jQuery.map - Practical uses for the function?

I am trying to get a better understanding of the jQuery.map function. So in general terms .map takes a array and "maps" it to another array of items. easy example: $.map([0,1,2], function(n){ return n+4; }); results in [4,5,6] I think I understand what it does. I want to under why would someone need it. What is the practical ...

How does one have Greasemonkey run before *anything* else in the page?

Is it possible to have Greasemonkey scripts run before anything else on the page? I'm aware of @run-at document-start, but this appears to run immediately after the <HTML> tag. Normally this isn't a problem, but if the page is misformatted as in the example below, there doesn't seem to be anything I can do. I'd appreciate any suggesti...

how can l get the image size, before it loads into html?

At first image height is coming as zero, after that by refreshing the page i am getting its actual height. I need to get its height at first time? could any body helps me? $j(document).ready(function(){ var imgV = new Image(); imgV.src="http://www.kerrvilletexascvb.com/Riverside%20Nature%20Center3.JPG"; ...

How can I control Javascript execution order?

I'm having some concurrency issues with a webpage I'm building. Basically, I have three script files that I'm using to hold some data: script1.js: `var myValue = 1;` script2.js: `var myValue = 2;` script3.js: `var myValue = 3;` And I have one page, mypage.html that basically looks like this: `<html> <script> function get_num...

vs 2008 javascript intellisense in XML file problem

I am trying to get javascript intellisense to work for jQuery in a .xml file. I've already used a custom XSD to provide intellisense for the XML. Under the tag, I have a mixture of HTML and javascript which are enclosed by . And it is all greyed out so no intellisense there. Adding a /// does not help as well. I would really like to ...

How to display an overlay label on a chart?

I have a chart created with Birt and I want to add some label on it to specify the 4 regions delimited by the 2 red markers (see image below), one label in each quadrant (centered if possible). I am looking for a solution to do that, directly using birt chart editor or by using a javascript (like I have done for the red markers). ...

Comet Javascript error

I'm using Orbited as a Comet server on localhost. It is listening to ports: 9000 for http 61613 for stomp My JavaScript debugger is reporting error: JSON is not defined in the line: var vals = JSON.parse(payload); What could be the cause and how do I resolve this issue? ...

How to set the style -webkit-transform dynamically using Javascript?

Hi, I want to change the -webkit-transform: rotate() property using Javascript dynamically. But the commonly used setAttribute is not working: img.setAttribute('-webkit-transform', 'rotate(60deg)'); The .style is not working either.. How can I set this dynamically in Javascript? I know some of you have experience dealing with this b...

What are xpath variable references for in Yahoo! widgets?

In an xpath expression, I understand that I can have variable references of the form $myVar I'm using Yahoo! widgets. What are these for? How would I set the value of myVar in the first place? Are these variables from the JavaScript? ...