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

[eluser]Mossab Alzeeny[/eluser]
Hello everyone,

Please... let me tell you my little Sad story :-S

I'm working on my first project using CI,

first i had to make a WHOLE Users system, but Thx to DX Auth
did the job and even gave me more functions that i wouldn't have dreamed of ^^

Then.... i needed to use ajax. Sad
first, i searched all over the wiki, and found few libs. but i picked (AJAX for CodeIgniter)

i didn't like the way it works actually ( to make a link, u'll have to use a function, to use a button u have to use Another function , and so on )

and also there's no need to use a WHOLE js framework just to call files through Ajax ... dont u think?

i know this library does more than just ajax files calling, this is the point. we need Ajax library, not a JS library

on top of all of this, the prototype lib, conflicted with the jquery lib (i used it for another purpose),

and when i solved the problem, guess what ? there was a problem with the prototype lib. it self,
so i said, (*beep* it) .. i worked on this thing for almost 7 hours and...
progress : 0, ZERO, NONE

then a brilliant idea came to my mind, why dont i use just the normal way to ajax things (add JS code to haeder, use ajax() function , code attached)!!! guess what again ? it WORKED Confusednake:


after a real hard day, i came up with few tips :
1- never give up with a code, because there's always a solution ( doesn't mean that u can forget your Deadlines
2- always save your own old codes, could help u someday
3- help ppl by showing the problems you had, maybe someone will help you, or maybe you'll help someone by showing him that, THERE'S NO SOLUTION FOR THIS ONE,!! lol


and the Most important thing,
We need an Official AJAX library from Codeigniter Team,

no that i think that no one can make a good lib. but only that im Pretty sure, many many people will get through all of this problems over and over, until we get the official library


so what do u think ?


* P.S: i know that many of you guys thinking ( lazzy ass, go make your own library, stop crying about it )
Well, THANK YOU :-P But you cant say we dont need it ,


Kind Regards.
Mossab
#2

[eluser]moodh[/eluser]
Stop crying about it.

joke ;p
#3

[eluser]Mossab Alzeeny[/eluser]
hahaha so funny
#4

[eluser]Randy Casburn[/eluser]
Mossab,

May I make a kind observation about a few of your comments? OK, I will anyway ;-)

First, you say...

Quote:i didn’t like the way it works actually...

about one method to implement what you desire with CI. How likely is it that someone would produce the perfect solution according to standards that you do like? In any event, please go back to the wiki and put 'ajax' in the search box at the top of the page. The results returned should be about two full pages of various solutions. You are bound to 'like' one of them.

Second, this next statement is baffling...

Quote:i know this library does more than just ajax files calling, this is the point. we need Ajax library, not a JS library

Can you help clarify what you mean by explaining what you believe the differences are between and 'Ajax library' and a 'JS library' as you've stated things here? Perhaps a short description in the differences in what you perceive the functionality to be between them?

Third, what if...

Quote:on top of all of this, the prototype lib, conflicted with the jquery lib (i used it for another purpose)...

and the CodeIgniter team had built the AJAX functionality a third approach that conflicted with both Prototype and jQuery? You would have your wish...the CI team would have built an AJAX library for CI. But would you have been happy with them or their work? Or would you blame them for creating an interoperability problem within your application?

========

This is a very complicated issue. The good news is that jQuery is going to be included with CI sometime in the future. That is good news because we'll be able to see some consistency within the CI framework when it comes to things like the use of AJAX. I don't think the team plans on building an "AJAX library", but I'm often wrong about many things,

Best regards,

Randy
#5

[eluser]Mossab Alzeeny[/eluser]
[quote author="Randy Casburn" date="1229250799"]Mossab,

May I make a kind observation about a few of your comments? OK, I will anyway ;-)

First, you say...

Quote:i didn’t like the way it works actually...

about one method to implement what you desire with CI. How likely is it that someone would produce the perfect solution according to standards that you do like? In any event, please go back to the wiki and put 'ajax' in the search box at the top of the page. The results returned should be about two full pages of various solutions. You are bound to 'like' one of them.
Well, i thought i made my self clear about this when i didn't say any functions i would like to see in the lib. it's not up to me to say exactly what functions it must have
all what i asked for is an official lib. from CI Smile because i Belive and i know that they will make the exact idea we're all thinking of ( not just me )
and i even looked on the other libs. (few of them) and i guess it wasn't as simple as i thought it will be ( not what we got used on while using CI official libs. )


Second, this next statement is baffling...

Quote:i know this library does more than just ajax files calling, this is the point. we need Ajax library, not a JS library

Can you help clarify what you mean by explaining what you believe the differences are between and 'Ajax library' and a 'JS library' as you've stated things here? Perhaps a short description in the differences in what you perceive the functionality to be between them?
as we all know, what AJAX really does, is calling files using the XMLHttpRequest object,
so, why would i download a lib. that has many many things that i dont really need ? ( talking about AJAX_for_CodeIgniter library) , as you can see there's too many functions that has nothing to do with AJAX(in my opinion) ,
such as (alert, assign, call, hide, redirect_to, remove, show, dragable_element, drop_receiving_element, sortable_element, visual_effect, in_place_editor etc.)


do you think all of these functions are really really Really important to call a file through AJAX ? then i guess take some of your time and read what is the AJAX

Third, what if...

Quote:on top of all of this, the prototype lib, conflicted with the jquery lib (i used it for another purpose)...

and the CodeIgniter team had built the AJAX functionality a third approach that conflicted with both Prototype and jQuery? You would have your wish...the CI team would have built an AJAX library for CI. But would you have been happy with them or their work? Or would you blame them for creating an interoperability problem within your application?
hmmm you wanna bet ? take a look at the code i attached in my first post, and see how Simple it is , and even go make your own tests and see if it conflicts with the other libs. even if it does, im sure with this few lines, you can fix it, but you CANT fix a whole library because you want to use only a PART of it, can you ? ( not talking about you as a person btw, )

========

This is a very complicated issue. The good news is that jQuery is going to be included with CI sometime in the future. That is good news because we'll be able to see some consistency within the CI framework when it comes to things like the use of AJAX. I don't think the team plans on building an "AJAX library", but I'm often wrong about many things,
never said i dont need a jQuery library or anyother library included with CI, im sure it will be even easier than usual, but we're talking about AJAX here, not JS libraries (Big difference)

[/quote]

P.S: i REALLY dont have anything against AJAX_for_codeigniter library, it's just happened accidentally that i used it,


Kind Regards.
Mossab
#6

[eluser]Randy Casburn[/eluser]
Ok...thanks for your reply.
#7

[eluser]Artemis Mendrinos[/eluser]
Hi,

Just to mention that I would be very happy to see jQuery officially included to CI.

I don't think I will need something more than the consistency as Randy mentioned.

Perhaps an upgrade of the official forms helper lib in order to display validation warnings with visual enhancements such as fading effects for example(with the power of jQuery).
#8

[eluser]Randy Casburn[/eluser]
@artemis - I agree.

A broad stroke that satisfies many appetites (jQuery) surely would be better than a non-cross browser, simplistic script as proposed above. Even if some view jQuery as having too much functionality.

Perhaps all that cross-browser support and other not-no-obvious goodness that is provided by these 'JS libraries' isn't understood by everyone. ;-)

Randy
#9

[eluser]Mossab Alzeeny[/eluser]
@randy - hahaha that was funny, maybe you didn't get my idea, no problem

but really, tell me. you want to load the whole jQuery library only to use ajax function ? well, good luck with that Mr.pro :p

P.S : the attached code above is just a sample, just to show you how simple it is Smile in case you think it's too hard to make it work on most browsers, i guess thats your own problem ..
#10

[eluser]Nick Husher[/eluser]
The big issue I see with including a javascript library as part of CodeIgniter is that javascript is fundamentally a client-side language while PHP is a server-side language. I'll be interested to see how the guys at EllisLab manage to reconcile the two environments.

That said, it is possible to make Ajax easier: at the moment it requires a fair amount of legwork to come up with a maintainable solution, and even then you're stuck with a lot of functions prefixed with ajax_, which can offend some aesthetic sensibilities (mine own included).

I took a stab at making handling server-side Ajax easier by developing a JSON-RPC library that behaves similarly to the core CI XML-RPC library. It allows you to send all your Ajax requests to a single method and recieve differing responses according to the JSON-RPC 1.1 Working Draft.




Theme © iAndrew 2016 - Forum software by © MyBB