simple javascript not working

Here's the code involved:

          <script language="javascript">
               function sms() {
                   alert("at sms");  /*this alert does NOT work*/
               }
          </script>

         <input type="checkbox" onclick="alert('at sms call'); sms();" /> <!-- when box is clicked, this alert works...-->

Any assistance will be most appreciated. This is driving me nuts! :-)

Thanks much,
softexecware
Jerry KrogerCTO - FounderAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Trenton KnewOwner / Computer WhispererCommented:
why are you calling the function and the function's function at the same time?  

What is it exactly this function is supposed to do?

What is returned when you click the button?  "at sms call" or "at sms"?
0
Jerry KrogerCTO - FounderAuthor Commented:
There are other things that will be added to the function, after it starts to fire.
"at sms call" is returned when the checkbox is clicked.
Then it should fire the function sms(), but that is not happening - and that's the issue
0
Trenton KnewOwner / Computer WhispererCommented:
This appears to work fine...
 <script language="javascript">
               function sms() {
                   alert("at sms");  /*this alert does NOT work*/
               }
          </script>

<input type="checkbox" onclick="sms();" /> <!-- when box is clicked, this alert works...-->

Open in new window

0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
         <script>
               function sms() {
                  alert('at sms call');
                   alert("at sms");  /*this alert does NOT work*/
               }
          </script>

</head>
<body>
    <input type="checkbox" onclick="sms();" />
</body>
</html>

Open in new window


http://jsbin.com/joleridito/1/edit
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jerry KrogerCTO - FounderAuthor Commented:
Thanks to each expert!
Both solutions worked.
...and forced the cache to update than my original code started working.
I have changed my settings to check for new versions every time a page loads.
Thanks again,
Jerry
Jerry@softexecare.com
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.