Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Help coderanch get a
new server
by contributing to the
fundraiser
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
HTML Pages with CSS and JavaScript
Checking a Boolean Value In JavaScript
Steve Dyke
Ranch Hand
Posts: 2232
2
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Using the following code it fires the load whether projectFlag equals true or false.
function updatedrawingliststatus(){ alert(projectFlag); if(new Boolean(projectFlag)){ $("#rmataskmanager").empty(); $("#rmataskmanager").load("/DrawingPDMW1/AccessRMATaskManagementServlet",{p1:diindex},getUDLSResults); } else{ alert("There is no Project in Resource Management for this Job Number."+"\r\n"+"Contact a Manager to have one added!"); } }
Eric Pascarello
author
Posts: 15385
6
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Well what you are doing looks to be the correct way to do it, but it is not.
new Boolean("any string")
produces true for any
string
. That means a string that contains
false
will be evaluated as
true
Your only real option here is to do
if(projectFlag=== 'true'){
Eric
Steve Dyke
Ranch Hand
Posts: 2232
2
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Is there any way to pass a boolean value from the
servlet
back to my
JSP
using AJAX(jQuery) call?
Eric Pascarello
author
Posts: 15385
6
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
if you
eval
/
new Function
it
That will cause more problems than just checking for the string.
Eric
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
start up a new session with confirmation message
How to check the correctness of input?
Alert Box/ Pop Up Problem
jQuery tabs UI issue
How to read a False Value
More...