javascript

Can I make one row show at a time in a table?

I have a javascript function that toggles the display for rows in a table. The dilemma is that I would like to display one row at a time. What is a neat way to do this? function optionSelected() { var optionSelect = document.getElementById('ddlSelect'); var strTest = optionSelect.options[optionSelect.selectedIndex]...

How to get HTML with “JavaScript enabled”?

I would like to get the HTML code from a page with PHP. So I do this: $url = 'http://en.wikipedia.org/wiki/New_York_City'; $html = file_get_html($url); The problem is, Wikipedia doesn't send the <script> tag to the PHP request, so it doesn't show the JavaScript. I guess that's because Wikipedia sees that the "requester" doesn't have J...

Pushing to Javascript Array from Jquery JSON request

Why does this code always return 0? var possibleMatches = new Array(); $.getJSON('getInformation.php', function(data) { $.each(data, function(i){ possibleMatches.push(data[i]); }) }); alert(possibleMatches.length); Though I can move or add "alert(possibleMatches.length);" inside the $.each and it will output the c...

Adding tool tips to dojo DataGrid items

I would like to add a tooltip with some extra data to each row in a dojox.grid.DataGrid. I have tried to create an onCellMouseOver handler, but I can't get the data item data out of the event object I'm getting. What is the best way to add a tooltip to a DataGrid row? ...

Firefox Cross Domain Request

I need to make a cross domain request from a script that runs in firefox (it's just for development purposes). Can this be achieved? maybe modifying the about:config keys? Thanks! ...

What are some good resources for learning how to implement Scheme Macros?

I've written a Scheme-ish language compiler/vm in JavaScript. http://github.com/z5h/zb-lisp Dybvig's "Three Scheme Implementations" paper (available on my github) was hugely important in getting stuff like tail-call-optimization, call/cc and other things working. I'm thinking about adding some type of macro support. And wondering if the...

Best way to add music to CMS-created sites without Iframes or ajax?

I'm doing some work on a site that let's users create their own mini-sites. My client wants users to be able to upload music and have it continuously play as visitors navigate the site. The only good way I can think of doing this is an Iframe, but obviously that will than get rid of unique URLs. I also don't want to use Ajax or a cook...

JQuery: Slide left and slide right

Hello, First of all, I am not that much experienced with JQuery, i have seen slideUp and slideDown, what about are the functions/ways for sliding to left and right? Thanks ...

How to give control back to iframe window after it opens a popup

Hello Experts, I have a question on javascript window management. My application opens an iframe which displays a link. Clicking on the link, opens a popup window, in which I enter my login credentials. My intention is to close the popup window after the login credentials are entered. And this I have been able to achieve using a JS ...

Creating a javascript widget for other sites

Hello, I am looking to create a javascript "widget" that can be hosted on other sites. For example. I want to host the javascript code on my site: http://scripts.mysite.com/mywidget.js (Think of it like Google Analytics). Basically I want to distribute data via this javascript. But what I am unsure of is: Are the rules different fo...

What is a good generic sibling control Javascript communication strategy?

I'm building a webpage that is composed of several controls, and trying to come up with an effective somewhat generic client side sibling control communication model. One of the controls is the menu control. Whenever an item is clicked in here I wanted to expose a custom client side event that other controls can subscribe to, so that I c...

jQuery toggle show/hide elements after certain number of matching elements

In implementing faceted search, if the number of options is 7 or less, I will show them all. If the number of options exceed 7, I will show the first 5 only and insert a link that will toggle the display of these options. My question in this case is, how to run through the list of matching elements, in this case li's that fall within .f...

Javascript Script Combining and Caching

I am building a AJAX intensive web application (using ASP.NET, JQuery, and WCF web services) and am looking into building an HTTP Handler that handles script combining and compression for my JavaScript files and my CSS files. I know not combining the scripts is generally a less preferred approach, and I'm sure it's probably the way I wil...

browser memory increasing constantly with javascript ajax calls

Hi, I have a strange behaviour. I am using a rather heavy page (4000 nodes) meant to display a dispatch system for delivery operations. Every 30 sec. I am refreshing with jquery, the list of operations (3000 nodes over 4000). It works perfectly well, but... each time, the memory of both firefox and chrome is increasing by 3 to 6ko. Of c...

What are best firebug equivalents for other browsers?

I sometimes need to debug JS in other browsers, and it would be really nice if they all had Firebug - failing that, what's the closest they have? ...

How would I debug this IE7 issue?

Problem: Conditions: IE7, SP2, latest flash/java. Only reproducible on one machine. Observations: Smaller than a javascript alert box, and seems to be generated when a swf on my web page loads. The dialog is modal, however, like an alert box. Issues: I've tried matching the configuration of the machine in question, but a recreati...

How do you catch errors thrown inside of a jQuery Plugin?

I tried to do this: try{ (function($){ ... my plugin stuff })(jQuery); }catch(er){ alert("an error occurred"); } but this doesnt seem to work =/ I'm also trying to figure out how to do this in Mozilla vs IE vs Chrome Thanks! ...

Javascript InnerHTML Erases Data In Form Elements

I have this form with a button that allows you to add fields to the form. <form id="contact" name="contactForm" action="newPoll.php" method="post"> <fieldset> <legend>Create A Poll</legend><br style="clear:both;"> <ol> ...

Laptop settings resizing web page pushing divs 'off' the page - is there a way around this via code?

Hi, My boss is running a laptop which has a setting which is resizing font sizes and making them larger by about a third. This is fine but we have a java app running on the site and the div tags are being pushed off of the page because of the increase in font size. Is there a way to stop font being resized, via code? Thanks, R. ...

How can I loop through table rows to toggle the display style?

I would like to toggle the display row for a table in javascript. How do I do this? <script type="text/javascript" language="javascript"> function vehicleSelected() { var autoSelect = document.getElementById('vehicleSelect'); var strAuto = autoSelect.options[autoSelect.selectedIndex].value; ...