Author Topic: JQuery  (Read 1465 times)

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14309
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
JQuery
« on: August 23, 2011, 04:49:35 PM »
I need to pass parameters to a function and it's not working for some reason.  Can I mix normal JS with JQuery stuff?
Code: [Select]
    <script type="text/javascript" src="javascript/jquery-1.5.1.js"></script>
   
    <script type="text/javascript">
    function copyNotification(role, type, location) {
    alert(role);
    $("notifyRole").val(role);
    $("notifyType").val(type);
    $("notifyLocation").val(location);
    };
</script>
It alerts the role properly, but it's not assigning the values.  Do I need to do something for it to recognize the JQuery stuff? 

If it helps, I'm calling it like this:

Code: [Select]
<a href="#" onclick="copyNotification('752', 'freeze', 'pe1v');">
                      <img src="images/copy.png" title="@@Copy" border="0">
                    </a>

Mike

  • Jackass In Charge
  • Posts: 11256
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Re: JQuery
« Reply #1 on: August 23, 2011, 05:08:53 PM »
$("notifyRole") is not a valid object.  Did you mean $("#notifyRole")?

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14309
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: JQuery
« Reply #2 on: August 24, 2011, 07:15:41 AM »
Gah... yes.  I copied that shit from stackoverflow.  I didn't even look at that part.

Thanks.