CHarris
CHarris

Reputation: 2793

jquery simple pop up not working for some reason

just trying to get this working:

 <script>

        $("#coming_soon").click( function()
           {
             alert('Coming soon....');
           }
        );
    </script>
<div class="header">
  <div class="populisto_logo">
    <div><%= link_to(image_tag('populisto_logo_for_web1.png', :alt => t('application.title')), root_path) %></div>

    <div class="top_bar">
      <div id = "menu">
        <ul id = "static_pages">
          <li><%= link_to "Create Contacts", reviews_path %></li>
          <li><%= link_to "Your Address Book", resource_home_path(current_resource) %></li>
          <li><a href="#" id="coming_soon">Invite Others</a></li>
          <li><%= link_to "About Us",about_us_path %></li>
         </ul>
       </div>
      </div>

Any ideas? I click the 'Invite Others' button and nothing happens....

Upvotes: 0

Views: 103

Answers (2)

Rustkill
Rustkill

Reputation: 51

For something as simple as an alert you could just try something like this:

<a href="javascript:alert('Coming soon....');" id="coming_soon">Invite Others</a>

No jQuery required.

Upvotes: 0

Your dom is not ready yeat when you call jquery. change your code to

$(function(){
     $("#coming_soon").click( function()
           {
             alert('Coming soon....');
           }
        );
  });

Upvotes: 1

Related Questions