Welcome Guest, Not a member yet? Register   Sign In
Problem with JQuery and CI
#4

[eluser]gtech[/eluser]
Hi I managed to get it working using the following modifications, note my URL was different (so replacing it with your URL should work).

I tested it using your about controller and created a test controller to load the view with the javascript.. when I made a selection the word HELLO appeared.

To get it working I had to use the onchange function in the select tag to call the javascript function. your jquery call was correct

Code:
<html>
  <head>  
    <script src="<?=base_url();?>js/jquery-latest.pack.js"></script>
    <script>
      var about=
      {  
        start: function()
        {
          $.ajax({
            type: "POST",
            url: "http://localhost/testcode/index.php/about/chris",
            data: "",
            success: function(html){
              $("#that").text(html);
            }
          });
        }
      }
    </script>
  </head>

  <body>
    <form name="this">
      <select name="cat" onchange="about.start();">
        <option value="one"/>One
        <option value="two"/>Two
        <option value="three"/>Three
      </select>

      <div id="that">
      </div>
    &lt;/form&gt;
  &lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
Problem with JQuery and CI - by El Forum - 12-02-2007, 02:14 PM
Problem with JQuery and CI - by El Forum - 12-02-2007, 03:10 PM
Problem with JQuery and CI - by El Forum - 12-02-2007, 04:36 PM
Problem with JQuery and CI - by El Forum - 12-02-2007, 05:37 PM
Problem with JQuery and CI - by El Forum - 12-02-2007, 05:57 PM
Problem with JQuery and CI - by El Forum - 12-02-2007, 06:01 PM
Problem with JQuery and CI - by El Forum - 12-02-2007, 06:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB