Create javascript function in codeigniter
<p>Hi I am trying to create a javascript function that I already have the php methods for.  Once I can send the url/path data it performs the function.</p>

<p>I am trying to send post_id to the php function (which I can do via myurl.com/dashboard/post_id) but I want to do it via javascript.</p>

<p>Here's what I have so far (it's not a lot):</p>

<pre><code>&lt;script type="text/javascript"&gt;
function vote(type,post_id) 
        {
        }
&lt;/script&gt;
</code></pre>

<p>and then:</p>

<p>onclick="vote('up','');"</p>

<p>I want to send post_id (using variable TYPE: )</p>

<p>myurl.com/dashboard/vote/$post_id</p>
