Click here to Skip to main content
15,117,882 members

Comments by Jonathan Cardy (Top 10 by date)

Jonathan Cardy 26-May-11 6:03am View
   
What is the string value of Session['priceday1']? Is it convertable to an int?
Jonathan Cardy 1-May-11 7:27am View
   
Yes, you're right: unless you are doing a lot of intensive computation in the Worker, it's pointless.
Jonathan Cardy 1-May-11 4:17am View
   
Your code is fine, I just made some small changes to get it to work:

- Wrapped your code in the window load event
- Uppercase 'W' in Worker

Also, does your browser definitely support Web Workers?

worker.js:
function applyValues(radius, size) {
return radius + "," + size;
}

/*
Add a event listener to the worker, this will
be called when the worker receives a message
from the main page.
*/
self.onmessage = function(event) {
var data = event.data;
postMessage(applyValues(data.radius, data.size));
};


page:
window.addEventListener("load", function(){
if (typeof (Worker) !== "undefined") {
var radius, size, message,
worker = new Worker("worker.js");

/*
Add a event listener to the worker, this will
be called when the worker posts a message.
*/
worker.onmessage = function(event) {
alert(event.data);
};

// Register event for button
document.getElementById("btn").onclick = function() {
message = {'radius': 2, 'size': 3 };
worker.postMessage(message);
}
}
}, false);
Jonathan Cardy 28-Apr-11 5:25am View
   
You might want to try Chrome - it provides useful debugging features for Web Workers and will give you a pretty accurate picture of what the end result will be in Blackberry.
Jonathan Cardy 18-Apr-11 16:50pm View
   
There are probably numerous problems, but to get you started, "<%=TextBox1.clientid%>" is not a CSS selector - try "$('#TextBox1')"
Jonathan Cardy 29-Mar-11 14:32pm View
   
I don't think there is going to be a quick fix. Your best bet is to continue on your CSS solution, but make it work in IE, of course.
Jonathan Cardy 27-Mar-11 5:01am View
   
In what direction do you want to slide them - up, down, left, right? What is your JavaScript currently?
Jonathan Cardy 24-Mar-11 12:26pm View
   
I know. Harsh!
Jonathan Cardy 24-Mar-11 7:17am View
   
I've updated my solution to be clearer. You haven't mentioned in your question what library you are using, and I am talking about the Google Geocoding service. JSON is irrelevant, you can request the data in XML format which presumably you have heard of.
Jonathan Cardy 19-Mar-11 12:54pm View
   
Deleted
I would agree that it's neater, but not everyone is familiar with the null coalescing operator so I would argue that "GetValueOrDefault" is easier to read/maintain.