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
Win a copy of
Eclipse Collections Categorically: Level up your programming game
this week in the
Open Source Projects
forum!
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
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
HTML Pages with CSS and JavaScript
Checking a Boolean Value In JavaScript
Steve Dyke
Ranch Hand
Posts: 2286
2
posted 15 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 15 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: 2286
2
posted 15 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 15 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
Destroy anything that stands in your way. Except this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
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...