javascript

JSON returned from ASP.NET WebService is inadequate

I have constructed several web services that successfully serialize my .NET types into JSON. However, I'm running into an issue getting the JSON to be fully compatible with the YUI library and the DataTable in particular. The YUI DataTable can be fully configured using JSON objects. I created the following struct in .NET to represent a...

Opera keyboard navigation

Hi, I am curious how does the Opera browser implement it's keyboard navigation, where you can do Shift+(Up|Down|Left|Right) and you travel along a row or a column. How would you implement this in javascript? Thanks ...

Ext.getBody().focus() not working in IE6

Ext.getBody().focus() does not appear to be working correctly in IE6. When a user navigates to a new ExtJS tab, I need to ensure he can no longer type into a CKEditor instance (hidden after navigating to a new tab) in which he might have been typing. The following code works in FF, but not IE6. for( var instanceName in CKEDITOR.instan...

Javascript behaviour difference between IE and Mozilla Firefox?

I have the following code which should update a label to say "please wait..", then run a function, and then update the label again to say it has completed: <asp:Button ID="Button1" runat="server" Text="Upload" onclientclick="document.getElementById('errorMessage').innerText='Please Wait...';" onc...

Calculating packet travel time in JavaScript

My server broadcasts a packet to a browser client every now and then. Is there any way to figure out how long it took from the packet from: server --> client I'm trying to time something, so ideally my JavaScript function would be like: var travelTime = {amount of time it took packet to get to me}; setTimeout('myFunction()', 3000 + ...

Solution for loading large JQuery image gallery

I'm upgrading some image galleries on a university website (needs to be standards compliant, to some degree). Most galleries are many pages of HTML. I've been using the jQuery plugin, Galleriffic, as well as some PHP code I wrote, to generate nice paginated galleries, and it looks great so far. I have two problems though. The first prob...

Using Javascript/jQuery to access HTML elements with improper id attribute

I'm making a Greasemonkey script for someone to change the display of some of the fields their CRM(Zoho) created because they don't have access to change the rendered HTML. This should be easy, BUT Zoho decided that creating proper HTML was too big a pain in the ass, I guess, and their HTML contains things like this: <input type="text"...

Send Email, not from my server

Is there any widget, or similar, that i could use to send an email for me? Something like i pass a post in some pre-defined way, this server would get it, parse it and send it to some email for me? More of a curiosity than a valid question itself... ...

jQuery event help - I have a Select list with OptGroups, I want to call function only if option belongs to a certain optgroup

Hi All, I have a select list with optgroups. I want to add a handler for the drop down selected index change, how do I tell which optgroup the selected item belongs to? This determines further execution path. I understand how to add the function, the function contents are more the issue. $ddl.bind("change", function(){ //how do I find...

jQuery cluetip: Manipulate content after rendering

Hi, I may be stating this incorrectly, but is there any way to manipulate (using JavaScript) the content in an cluetip once the content has been (dynamically) loaded to the external .jsp? I have a list of items being displayed, and I want to bold some of them. I cannot add ID's or classes individually to any of these items in the list, ...

Will I be able to read this through Ajax (jquery)?

I need to call the server AJAX-way, just to get 1 parameter: Must I do this through JSON? Or, can I just shoot this through like a regular HTML page, like this: 4 or 6 Then, will JavaScript be able to read that line? If so, how can I do this using jQuery? ...

Node.normalize() crashes in IE6

I am doing some manipulation of TextNodes in javascript, and I (unfortunately) need to support IE6. Node.normalize() is crashing, and I need to work around this. My first inclination is to just re-implement it using other DOM methods. How would I implement this? ...

What does /.*=/,'' mean in var id=this.href.replace(/.*=/,'');?

What does /.*=/,'' mean in var id=this.href.replace(/.*=/,''); ? Full code function delete_subscriber(){ var id=this.href.replace(/.*=/,''); this.id='delete_link_'+id; if(confirm('Are you sure you want to delete this subscriber?')) $.getJSON('delete.php?ajax=true&id='+id, remove_row); return false; } I assume it is regex, bu...

How can I make a DIV take up the rest of the height of a container div?

Hi All, I have a div with two nested divs. The first child has varying height depending on its content, I want the the 2nd divs height to be whatever is left over from the parent. <div style="height:500px;"> <div>Some Content Here</div> <div>This div needs to take up the rest of the space of its parent</div> </div> How can I do...

Loading text file from web, and parsing it with a script?

My .html has some associated data in a .txt file that I need to load when the page is loaded. I then need a script to be able to parse that data and do stuff with it in the page. Is there a quick-n-dirty way to do this? I was thinking I could just have a hidden and then run through its innerHTML, but DIVs don't seem to support that. ...

How to select a specific record from the store in a ComboBox (ExtJS)

I have a ComboBox with a remote json store. It lets the user type in 3+ characters, then queries, displays list and lets user select one option. When the user selects an option, it uses the Ext.data.Record associated to the selected option to populate other fields elsewhere in the form. This works correctly. Now I want to be able to pr...

Local web storing of files using HTML5

Hi, I was fascinated by Google Gears and its potential use in online game development, particularly massive online game development. One could take the game resources and store them locally using ResourceStore, thus reducing game load time, server bandwidth issues, etc. I have therefore welcomed the news that HTML5 supports offline stor...

Assign variable to manipulated data from jQuery getJSON results

How to assign a variable to returned JSON data that has been manipulated with .replace() as shown below. Purpose: build the URL for the video thumbnail image from video ID returned by JSON. Question: How to assign a video ID (ex. mVWhWsgHzKM) to a variable so thumbnail URL can be constructed. $.getJSON( 'http://gdata.youtube.com/fe...

clicking on a div's scroll bar fires the blur event in I.E.

Hi, I have a div that acts like a drop-down. so it pops-up when you click a button and it allows you to scroll through this big list. So the div has a vertical scroll bar. The div is supposed to disappear if you click outside of the div, i.e. on blur. the problem is that when the user clicks on the div's scrollbar, IE wrongly fires ...

How to determine if hidden/overflow text is at top or bottom of element

I'd like to expand on Shog9's answer in How to determine from javascript if an html element has overflowing content And I'd like to know if the text that is hidden is at the top or at the bottom (or both or none) of the containing element. What's the best way to go about that? ...