Welcome Guest, Not a member yet? Register   Sign In
Global form validation callbacks? Staged forms?
#8

[eluser]tomclowes[/eluser]
Looking into the callback now,

Ok. Being new to CodeIgniter, and only really having gotten into JS for my users experience, your post went over my head. I have tried to get my head around it and understand it as follows.

I need my base_url in my javascript files. This can be done by settting it as an object (in your example).

To test this, I defined a similar 'thing' - I am unsure how what you have written is an object as I was under the impression an object was contained with {}braces. Is this not simply a function?

None the less if in my javascript files i refer to excitecms.base_url it returns
Code:
function () {
        return "<?php echo base_url() ?>";
    };
when what i want is simply
Code:
mybaseurl.com
.

Essentially i am confused as to your usage of functions as opposed to defining
Code:
var excitecms.base_url=<?php echo base_url();?>";
.

Then if i understand correctly you are saying that i could have a controller named 'ajax' with various different functions accessed by /ajax/function1/, /ajax/function2/ etc which do the processing of my JS. That way I have access to the CI object?

I'm terribly sorry if i have completely missed your point. Thank you.


Messages In This Thread
Global form validation callbacks? Staged forms? - by El Forum - 09-03-2010, 01:35 PM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 04:23 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 04:51 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 06:35 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 07:22 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 08:21 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 10:25 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 12:21 PM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 12:38 PM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 04:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB