Welcome Guest, Not a member yet? Register   Sign In
What's the underlying name-value parameter structure look like?
#1

[eluser]Wayne Smallman[/eluser]
Hi guys!

I'm working on an Ajax feature that simply will not work with the prettified URLs CodeIginiter is using.

So my question is, when I use:

Code:
example.com/controller_name/function_name/parameter_value

What would that look like in good old-fashioned name-value pairs?
#2

[eluser]Nick_MyShuitings[/eluser]
If you check the config/config.php around line 130 you can see how that might work.

example.com/index.php?c=controller&m=function&parameter=parameter_value

But I've never had problems with AJAX and CI, so if you want to explain your dilemma a bit more I bet the community can get it working.
#3

[eluser]Wayne Smallman[/eluser]
Hi and thanks for the reply!

OK, I have a text link that when clicked, a floating division appears containing a form. I used a script from Dynamic Drive for this purpose.

As you can see, there's a anchor parameter that allows you to specify a URL, where the content of which is flowed into the floating division.

However, this does not work with the prettified URLs of CodeIgniter, but works fine regular URLs, like "file.html", for example. And since I need the ID value part being passed by the URL, the whole thing stops working.

I know almost nothing about JavaScript, so there's no way can I edit the source file to fix this problem. So the only option left to me was to use a URL that comprises vanilla-floavoured name-value pairs — thus this thread.

If you know of any alternative methods, that would be excellent!
#4

[eluser]Atharva[/eluser]
Sorry if I have misunderstood you, but can't you use POST instead of GET?
#5

[eluser]Wayne Smallman[/eluser]
Hi Atharva!

Yes, you've misunderstood. But thanks for taking the time to reply, anyway.
#6

[eluser]Nick_MyShuitings[/eluser]
Wayne,

That script is somewhat odd. I'm a personal fan of jQuery, and tools like fancybox work right out of the install.

Check out the example at http://fancybox.net/ of the ajax. Its based on jQuery and uses the jQuery .post() or .load() functions.

I don't know how much time you've put into implementing that script, but it seems very limited.

from the example I sent I just tested this:

Code:
HTML

<a id="various3" href="example.com/controller/model/paremeter">Ajax - passing custom data</a>

JS

$("#various3").fancybox({
        ajax : {
            type    : "POST",
            data    : 'mydata=test'
        }
    });

OOOOORRRR

HTML

<a id="various3" href="example.com/controller/model">Ajax - passing custom data</a>

JS

$("#various3").fancybox({
        ajax : {
            type    : "POST",
            data    : 'ParameterNameForPost=ParameterValue'
#7

[eluser]Wayne Smallman[/eluser]
Nick, thanks for the feedback.

As I said, JavaScript (and by extension jQuery) is beyond me.

For now, I've gone old-skool and used proper links. But I definitely have a need for jQuery coding at some point. So I'll come back to this thread later on.

Thanks again.




Theme © iAndrew 2016 - Forum software by © MyBB