javascript

Website Theme for IPhone - What are The Basic Ingredients?

Has anybody made a website theme for the iPhone? Please let me know any tips or resources. Here's my theory: How to make a website theme for iPhone Create a website theme designed for desktop monitors. Try not to make any element larger than 320px (iPhone screen resolution). Create 2 style sheets. One for desktop monitors and another...

Adding a variable to a ASP.NET CustomValidator

I need to have a custom validator that can in some way incorporate a custom variable when calling the client-side javascript validation. This validator is used in a repeater, and every item in the repeater needs to use the custom validator, but validating against its own variable. Is this possible and how can I do it? Example, I nee...

jquery ajax parse response text

Ok this is really frusturating me because I've done this a hundred times before, and this time it isn't working. So I know I'm doing something wrong, I just can't figure it out. I am using the jQuery .get routine to load html from another file. I don't want to use .load() because it always replaces the children of the element I'm load...

First sums, second doesn't -> why?

<!-- first --> <script> var total = 0; var newAccumulator = function() { return function(i) { total += i; }; } var foldl = function(arr, putNum) { for (var i = 0; i < arr.length; ++i) { putNum(arr[i]); } } foldl([1, 2, 3, 4], newAccumulator()); document.write("Sum: " + total + "<br/>"); </script> <!-- second --> <script> v...

Fastest way to iterate through JSON string in Javascript

Hello, I have been using $.each of the jQuery framework to iterate through a JSON string that I receive via an AJAX call. Now this string is sometimes quite huge and as a result IE6/7/8 crawl as a result. I am wondering if there is a faster way to iterate through the entire data. Thank you for your time. ...

How to add hours to Javascript Date object?

It amazes me that Javascript's Date object does not implement an add function of any kind. I simply want a function that can do this: var now = Date.now(); var fourHoursLater = now.addHours(4); function Date.prototype.addHours(h) { // how do I implement this? } I would simply like some pointers in a direction. Do I need to ...

YUI Charts Styling

Hello people. Through my search for a open-source charting system, I found the YUI library. So here is the question. How can I make the x-axis and y-axis transparent. style: { border: {color: 0xD0D696, size: 1}, font: {name: "Arial", size: 10, color: 0x559330}, dataTip: { border: {color...

Get the HTML contents of another frame on another domain

Hi I've read that you cannot read the HTML of another frame if that frame resides on another domain. Is there a way to do this in Javascript? I realise this restriction is for security purposes but my use is legitimate. Regards Peter ...

How can I get this eval() call to work in IE?

I have some javascript that goes out and fetches a javascript "class" on another xhtml page. The remote javascript looks something like the following: (function() { this.init = function() { jQuery("#__BALLOONS__tabs").tabs(); }; }) After this is fetched into this.javascript, I try to eval it and ins...

getAttribute in Firefox 3.5 and IE8 doesn't work how it used to.

I am creating a javascript function that would find an anchor in a page (specifically with , not an id) and then iterate through the parents of it until it reached one that contains a certain class. I used the following code and it works fine in Firefox 3.0 but fails at getAttribute in both Firefox 3.5 and Internet Explorer 8. var tab =...

When is it safe to use .toString()?

Doesn't value have to return toString() to be able to call value.toString()? When do you know you can call value.toString()? <script> var newList = function(val, lst) { return { value: val, tail: lst, toString: function() { var result = this.value.toString(); if (this.tail != null) result += "; " ...

ASP.NET how to tell if div is scrolled to the bottom.

I have no idea how to do this and I need assistance please. I am using asp.net and I have a div with overflow:auto set. The div shows terms and agreements. I also have a asp.net checkbox control with visible set to "false". What I want is a way to make checkbox visible = "true" only after the user scrolls all the way to the bottom. I was...

jQuery Cross Site Fetch

Hi, I feel like this is easy but I am missing something... Using jQuery, I am trying to fetch a remote page (on a different server), capture the HTML contents, and inject that content into a hidden DIV. However, using either $.ajax or $.get results in a cross-site scripting error in FireFox. Any suggestions? Code: $.ajax({ t...

Convert JSON array to an HTML table in jQuery

Is there a really easy way I can take an array of JSON objects and turn it into an HTML table, excluding a few fields? Or am I going to have to do this manually? ...

How can I control IE6+jQuery+jQuery-ui memory leaks ?

Here's a sample page with a couple datepickers. Here's the Drip result for that: This page leaks indefinitely in IE6sp1 when I click the Refresh button repeatedly (IE6sp3+, Opera 9, Chrome2, and FF3+ seem to be good). The memory goes up and never goes down until I actually close the browser completely. I've also tried using the lates...

ridonkulous large-font display issue. fontSize shatters words all over

I'm in the midst writing a Lessig-Method slideware object in javascript (so something fun, not important), and I keep encountering strange text layout anomalies, the likes of which I can't say I've ever seen. And yet, they are pervasive across my slides. The background is straight-forward. Presentation has Slides, and Slides have Lines....

Can I change the context of javascript "this"?

var UI$Contract$ddlForm_change = function() { debugger; //'this' is currently the drop down that fires the event // My question is can I change the context so "this" represents another object? this = SomeObject; // then call methods on the new "this" this.someMethod(someParam); }; is this possible? Thanks, ~ck in San Di...

Javascript Window.Opener Object Null on .NET WebBrowser Control New Window

Well I have a Pop up in the WebBroswer control of the .NET Framework that I capture with the NewWindow event handler like so. WebBrowser w = new WebBrowser(); SHDocVw.WebBrowser_V1 web = (SHDocVw.WebBrowser_V1)w.ActiveXInstance; web.NewWindow += new SHDocVw.DWebBrowserEvents_NewWindowEventHandler(web_NewWindow); The new Popup is in a ...

client side xslt with javascript in firefox

I am using client-side xslt to transform xml files into xhtml. There have been some hurdles but I have managed to get passed all of them except this. The problem is that when I have a simple xml file like this <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="./jsInFf.xsl"?> <root>hello</root> and tr...

jQuery Intellisense using something other than $

I'm currently using two libraries (prototype and jQuery), thus I've implemented the jQuery noConflict method and set it equal to $j: var $j = jQuery.noConflict(); Problem is, now the jquery-1.3.2-vsdoc.js doesn't recognize my $j as a valid entry argument. Is there a way to change this? I've played around with the jquery-1.3.2-vsdo...