15,791,100 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.
Show More