Welcome Guest, Not a member yet? Register   Sign In
We need official AJAX library from CI team !
#21

[eluser]xwero[/eluser]
Randy the event handlers you are talking about are in the view which outputs html. It should not matter if the content of the view is generated by php, python or perl. As long as the html stays the same your javascript code doesn't need to change.
#22

[eluser]Xeoncross[/eluser]
[quote author="Randy Casburn" date="1229373379"]onClick(), onContext(), etc.) we're reminded that all those event handlers get built into our presentation logic when we're coding our View parts of the MVC.[/quote]

What!? Who still embeds JS into HTML!? Come on guys - this is almost 2009. JavaScript has no business inside your HTML views. It should stay in it's own file - far away from our valid XHTML.
#23

[eluser]Randy Casburn[/eluser]
Alrighty then Xeon - tell me how you're going to press a button and invoke an AJAX response from the server without an onClick() javascript function within your HTML tag?
#24

[eluser]xwero[/eluser]
Xeoncross when i responded i didn't mean i still use those tag attributes but you need to link the event functionality somehow to tags. The way it's done now is by using classes but they have to be added too. And that is what Randy meant by the link between php and javascript.

I try to use dom traversing as much as possible but sometimes you have to use classes or ids.

Are the attributes written out of XHTML? AFAIK they are still a part of the specification.
#25

[eluser]Randy Casburn[/eluser]
binding the events the objects goes directly to my post to xwero by the way!
#26

[eluser]Xeoncross[/eluser]
[quote author="xwero" date="1229377903"]Xeoncross when i responded i didn't mean i still use those tag attributes but you need to link the event functionality somehow to tags. The way it's done now is by using classes but they have to be added too. And that is what Randy meant by the link between php and javascript.

I try to use dom traversing as much as possible but sometimes you have to use classes or ids.

Are the attributes written out of XHTML? AFAIK they are still a part of the specification.[/quote]

Ok, I just wanted to point that out.

As far as I am aware, event handlers built into (X)HTML are invalid and cause issues with some of our favorite browsers. Plus, it is much cleaner to tie events to DOM elements by a class or ID than it is to place a bunch of JS in the element.

Code:
<a href="#" class="ajax_popup">Modal</a>
vs
a href="#" ONMYEVENT="MYJAVASCRIPTFUNCTION;"Modal/a
//JS is filtered in this forum. ;)


Quote:Alrighty then Xeon - tell me how you’re going to press a button and invoke an AJAX response from the server without an onClick() javascript function within your HTML tag?

haha, I think you've been in PHP too long my friend. Go check out jQuery or Mootools and see what you can do with a good lib behind you. It will help you to break out of the old embeded JS ideals. (And yes, you can still use DOM and events even if you don't have a JS lib)
#27

[eluser]Michael Wales[/eluser]
The EllisLab Team, namely Derek Allard, have already stated that some jQuery goodness is coming to CodeIgniter. I believe they are making use of it with EE2 - I would assume after EE2 is released we will see a new version of CI released shortly thereafter.
#28

[eluser]Xeoncross[/eluser]
Well, as long as it isn't built into CI that is fine with me Wink
#29

[eluser]Michael Wales[/eluser]
I would assume it will be a library/helper - just like any other portion of CI, you won't have to use it if you don't want to.
#30

[eluser]Xeoncross[/eluser]
[quote author="Michael Wales" date="1229380022"]you won't have to use it if you don't want to.[/quote]

And I almost forgot why I loved CodeIgniter...




Theme © iAndrew 2016 - Forum software by © MyBB