function vepro(faqja)
{
if (faqja = 'contact')
{
var ask = confirm("You want to delete this contact?");
}
else if (faqja = 'kid')
{
var ask = confirm("You want to delete this kid?");
}
}
4 replies to this topic
#1
Posted 18 June 2011 - 04:28 PM
I have a function in JS but when I call it vepro('contact'); OR vepro('kid') it shows the same result the result is "You want to delete this contact?". So I can never get "You want to delete this kid?" What may be the problem?
|
|
|
#2
Posted 18 June 2011 - 04:45 PM
Can you show how you're calling this?
#3
Posted 18 June 2011 - 04:49 PM
This codes above gives me the same result the first result as I said in the first post:
<a href="#" onClick="vepro('contact')" title="Fshi" class="icon-2 info-tooltip"></a>
AND
<a href="#" onClick="vepro('kid')" title="Fshi" class="icon-2 info-tooltip"></a>
#4
Posted 18 June 2011 - 07:29 PM
function vepro(faqja)
{
if (faqja == 'contact')
{
var ask = confirm("You want to delete this contact?");
}
else if (faqja == 'kid')
{
var ask = confirm("You want to delete this kid?");
}
}
You have to use == for comparison. = is assignment, and non-null evaluates to true.
#5
Posted 19 June 2011 - 10:54 AM
Thanks a lot I though that I tried once with == but who knows what I did wrong then, now it is ok.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









