javascript

Turning nested JSON into an HTML nested list with Javascript...

Hi Everyone, I'm fairly new to using JSON (as opposed to XML) and am currently working purely with Javascript to digest, parse and display my returned JSON data. I'm using the JSON2.js library and am getting back some valid JSON data representing a fairly simple nested list: { "node":{ "class":"folder", "title":"Test Framewo...

JavaScript-like anonymous functions in C#

Can the following be done in C#?: var greeting = "Hello" + function () { return " World"; }() + "!"; I want to do something along the lines of this (C# pseudo code): var cell = new TableCell { CssClass = "", Text = return delegate () { return "logic goes here"; }}; Basically I want to implement in-line scoping of some logi...

OffsetLeft and OffsetTop issue in IE

Facing offsetLeft and offsetTop problem in IE while trying to create one tooltip which will create each time when we click on different events on calendar.. the following is the code which will work good for firefox but creating problem for IE. can tell me the solution for this.. var ttip = __createElement("div","ttipbox","ttipbox"); //...

Ruby function in onclick event

can we def some ruby function (other than javascript) in onclick event for radio button in rails.. for example <%= radio_button(count, voting.vote_count, :onclick => "if voting.nominees.eql?(selected.nominees) voting.update_attribute('vote_count',voting.vote_count+1 )") can i use like this.. ...

javascript tables

I'm having an issue with looping through a table in javascript and getting the text from the first cell of a row. I want to get the text of this cell so that I can compare it with something else and remove the row if the text matches. When I try to get the text though, all that actually comes out is "[object text]". Can anyone tell me ...

Changing the title of a link in jQuery

I have a link with id "helpTopicAnchorId". I want to change its text in jQuery. How do I do this? ...

IE6 Unit PNG fix + Javascript Swap Image not working

Hi Everyone, I am using Unitpngfix for IE6 PNG Transparency. Everything moves fine. Now i need to implement a menu button in png to swap when mouse over. I used dreamweaver "Add Behaviors > Swap Image". It generates a java script code. Swap Image Script: function MM_preloadImages() { var d=document; if(d.images){ if(!d.MM_p) d.MM_p=...

ASCX controls and window.onload function

Is it possible for asp.nt ascx controls to have their own client side load event, like a window.onload for each, so I can hide the loading divs and show the content div when http transfer is complete. I have image menus and cycle galleries that seriously need some loading progress don't know how to implement them. The site is http://te...

Horizontal and Vertical complicated Javascript Calculation and Coldfusion

Now the table is being populated with 2 loops and an array. I have to control everything through the classes I put on the input. Been working on this for a while, some insight would be helpful. Here is the loop and the inputs: <cfloop from="1" to="#ArrayLen(labels)#" index="r"> <tr> <td class="labels"><cfif ArrayIsDefined(...

javascript error while reading xml file in ie

I am facing problem for reading xml file using javascript. It works fine in other browser but in it its throw the following error. Microsoft JScript runtime error: 'null' is null or not an object My code snippet is as below. GDownloadUrl("<?php echo $cfg->webroot;?>/G-map/map_xml/<?php echo $_SESSION['xml_file_name'];?>", fun...

When should I use the syntax "(function() {...})();" ?

My query is used in cases that "(function() {...})();" Given that I am not a plugin. For example "http://piecesofrakesh.blogspot.com/2009/03/downloading-javascript-files-in.html" (function() { var s = [ "/javascripts/script1.js", "/javascripts/script2.js" ]; var sc = "script", tp = "text/javascript", sa = "setAt...

Extjs radio addevent problem

Hi ; i'am add radio buttons on click event. but not working. my code : RadioPanel : RadioPanels = new Ext.Panel({ layout: 'table', id: 'newRadioEdit', name: 'newRadioEdit', //title:'Servis Durumu', bodyStyle: Ext.isIE ? 'padding-left:35px;' : 'padding-left:35px;...

jQuery UI " $("#datepicker").datepicker is not a function"

When i use DatePicker, jQuery's UI plugin, in an existing .aspx page i get errors that "$("#datepicker").datepicker is not a function". However, when I copy and paste the same code that creates and uses the DatePicker to an html file that's also in the same directory as the aspx page, it works flawlessly. This leads me to assume that the...

SAS printing to file

I have a SAS file handle created as such: filename filehandle "report.htm"; I have several files (packed Javascript files) which have very long lines (>32K in length). I would like a way to append their contents to the file above. I know that if I do: data _null_; file filehandle; put "very long string here"; run; Sometime...

Order of evaluation in JavaScript code using Ajax

It seems (to me) like javascript statements do not always run one after another. I know they do that way but sometimes it seems like a show() func tion fires at the same time with hide() so the logic fails. There are callback functions to use, like jQuery.load("some.html",thenrunthis) .. I need to understand the working logic. any help/...

How can I check to see if the user is anonymous or logged in from javascript?

I would like to determine whether or not the user is logged in or if they're just anonymous from javascript... I found this question, but it's php code and I wasn't sure if there is a session variable called logged_in that gets stored on login or if that was just something that person had implemented himself. Anyone know how I can che...

Jquery: one call triggered by multiple events

I have a simple search page with a single input box. I want to be able to trigger the search action either by clicking "Go" or by pressing Enter in the input box. I did it like this: $("input[name='entry']").keyup(function(event) { if (event.keyCode == 13) { search_...

javascript or PHP option to detect AIM status

The website is http://www.ipalaces.org/support/ The code I use for the status indicators is <img src="http://big.oscar.aol.com/imperialpalaces?on_url=http://www.ipalaces.org/support/widget/status_green.gif&amp;off_url=http://www.ipalaces.org/support/widget/status_offline.gif"&gt; which is a neat thing that big.oscar.aol.com lets yo...

Firefox Flicker Bug

Is there any sort of workaround for the bug that makes firefox flicker when decreasing the size of the document? Click here for a demo Click here for the demo in quirks mode (no DOCTYPE) I bet it could be fixed using javascript -- whenever the scrollbar shrinks, make sure to scroll the window up to prevent the flicker or something.. t...

Writing a search-with-suggestions field. Javascript focus problem.

So I'm scripting up a search field for my website. As the user types, a box appears below the field with search suggestions. The suggestions are keyboard navigable and clickable. However, I'm having trouble getting the suggestions to disappear when the user click's elsewhere on the page. I've added an onBlur() handler to the search fiel...