Part of the EllisLab Network
   
3 of 3
3
Poll
Do you agree that we need an official AJAX library ?
Yes! please 134
NO! dont waste your time, CI team!! 21
being a noob doesn’t mean we should make a whole library for you! 7
Total Votes: 162
You must be a logged-in member to vote
We need official AJAX library from CI team !
Posted: 15 December 2008 01:58 PM   [ Ignore ]   [ # 31 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  378
Joined  09-11-2006
Xeoncross - 15 December 2008 05:12 PM
<a href="#" class="ajax_popup">Modal</a>
vs
a href
="#" ONMYEVENT="MYJAVASCRIPTFUNCTION;"Modal/a
//JS is filtered in this forum. ;) 

Although, even this is technically poor style, since users with javascript disabled (like our poor friend the GoogleBot) will click on the link and get no response at all. What you want to be doing is:

// myview.php
<a id="click-me" href="http://example.com/mycontroller/myfunction">Modal</a
// myscript.js
YAHOO.util.Event.addListener("click""click-me", function(eventObject{
    eventObject
.preventDefault();

    
// present some information with javascript
}); 
 Signature 

August 2011: I’m not an active codeigniter developer right now. Feel free to contact me, but I may not be able to solve your problem for you.

flickr | twitter | rockets

Profile
 
 
Posted: 15 December 2008 02:08 PM   [ Ignore ]   [ # 32 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008
Nick Husher - 15 December 2008 06:58 PM

What you want to be doing is:

// myview.php
<a id="click-me" href="http://example.com/mycontroller/myfunction">Modal</a
// myscript.js
YAHOO.util.Event.addListener("click""click-me", function(eventObject{
    eventObject
.preventDefault();

    
// present some information with javascript
}); 

Yes, I am glad you mentioned that. I just wanted to keep my example simple so people would understand. Your site should work whether that sweet-looking JS modal pops up or not. For example, my blog sends ALL requests as AJAX requests unless you are the GoogleBot or a user without JS - then it downgrades and works like a normal site as Nick showed.

JS should ONLY enhance your site - it shouldn’t be required to run it!

 Signature 

My Blog, C2D, PHP Videos, CXTags, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
Posted: 15 December 2008 02:59 PM   [ Ignore ]   [ # 33 ]  
Lab Technician
RankRankRankRank
Total Posts:  1040
Joined  06-19-2007
Xeoncross - 15 December 2008 07:08 PM

JS should ONLY enhance your site - it shouldn’t be required to run it!

So much for AJAX then, I guess?  That was the OPs point of the thread.

 Signature 

My new therapist is working with me every day, the third one gave up… ohh

Profile
 
 
Posted: 15 December 2008 03:28 PM   [ Ignore ]   [ # 34 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008

Uh… no.

AJAX is a nice way to KILL the boring re-load of a page and provide a nice simple pop or instant change to some content on the page. It is NOT built as anything other than a convenience to improve the users experience (it saves time and is easy for them).

However, your site should work fine without them as well. JavaScript and Flash are only for a better user experience IF AND ONLY IF they can handle/support it. Only inexperienced/lazy front end programmers would force a user to use something like JS or Flash (thereby locking everyone that can’t out).

 Signature 

My Blog, C2D, PHP Videos, CXTags, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
Posted: 15 December 2008 04:13 PM   [ Ignore ]   [ # 35 ]  
Lab Technician
RankRankRankRank
Total Posts:  1040
Joined  06-19-2007
Xeoncross - 15 December 2008 08:28 PM

Only inexperienced/lazy front end programmers would force a user to use something like JS or Flash (thereby locking everyone that can’t out).

Please inform all the people building applications listed here:http://extjs.com/company/customers.php they are inexperienced/lazy.

Then turn off javascript and flash peruse some of these sites:

http://www.nortel.com/
http://www.motorola.com/us
http://www.samsung.com/us/
http://www.csc.com/
http://www.interwoven.com/
http://www.hp.com/sbso/index.html
http://www.panasonic.com/
http://www.youtube.com/watch?v=GVuBPaJsNQc&feature=poptersr5


Interesting how the some the the biggest money makers in the world don’t fit nice and neatly into our molds.  This has been the case with Google and HTML validation for years.

Interesting in deed how the real world works.

 Signature 

My new therapist is working with me every day, the third one gave up… ohh

Profile
 
 
Posted: 15 December 2008 04:45 PM   [ Ignore ]   [ # 36 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008

You don’t seem to get it. I never said people couldn’t build sites that would break - I never said people wouldn’t continue to build sites that break. The fact that there are poor practices out there has nothing to do with the goal of good coding.

Most people do a lot of dumb stuff - but does that make it right? Does that mean we should never try to show them a better way?

I can’t force anyone to build things the right way (so they are indestructible). Afterall, people are just lazy now-a-days and build sub-standard work.

But unlike you I don’t congratulate them for their sub-pair efforts. If you have a job - do it right.

 Signature 

My Blog, C2D, PHP Videos, CXTags, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
Posted: 15 December 2008 05:07 PM   [ Ignore ]   [ # 37 ]  
Lab Technician
RankRankRankRank
Total Posts:  1040
Joined  06-19-2007

To get past the idealism for idealism’s sake, and back on topic, the OP said:

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

This is so true of so many coding dilemmas. Whether AJAX, user authentication, DB abstraction, modularization, and on and on.

These discussions are valuable as they give a sense of the communities value assessment of feature sets.

It’s all good.

Randy

 Signature 

My new therapist is working with me every day, the third one gave up… ohh

Profile
 
 
Posted: 15 December 2008 05:13 PM   [ Ignore ]   [ # 38 ]  
Lab Assistant
RankRank
Total Posts:  111
Joined  12-13-2008

Just for the sake of argument.

Let’s say, CI team agrees to put an AJAX framework in there (I’d love see it but, read on). Now question is,

- User JQuery
- Prototype
- Write their own

Let’s say, they write their own then all Prototype fans will scream about it and so on.

Let’s again assume that everybody likes the idea of CI team developing their own. Why would they do that when there are already used and tested libraries out there (Prototype, JQuery).


So, either they favor one framework over other and FORCE developers to use a particular one (specially if they prefer other one). OR they write their own and (again) FORCE developers to learn a new framework.


Like I said before, I like the idea of inbuilt AJAX library but (unfortunately) we have to see the bigger picture here.


Well that’s my opinion. Couldn’t resist. Don’t flame me please smile smile

Profile
 
 
Posted: 15 December 2008 05:22 PM   [ Ignore ]   [ # 39 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008

Hey Jaswinder, check one page back for the answer. wink

 Signature 

My Blog, C2D, PHP Videos, CXTags, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
Posted: 15 December 2008 05:23 PM   [ Ignore ]   [ # 40 ]  
Lab Technician
RankRankRankRank
Total Posts:  1040
Joined  06-19-2007

Perhaps you missed this http://codeigniter.com/forums/viewreply/504263/ from above?

@Xeon - Way to go speedy!  LOL

 Signature 

My new therapist is working with me every day, the third one gave up… ohh

Profile
 
 
Posted: 15 December 2008 05:29 PM   [ Ignore ]   [ # 41 ]  
Lab Assistant
RankRank
Total Posts:  111
Joined  12-13-2008
Xeoncross - 15 December 2008 10:22 PM

Hey Jaswinder, check one page back for the answer. wink

Ah well. I think i’ll take a break and go for coffee.

But you din’t have to mean and point it out grin

Profile
 
 
Posted: 15 December 2008 05:51 PM   [ Ignore ]   [ # 42 ]  
Grad Student
Avatar
Rank
Total Posts:  34
Joined  12-04-2008

Michael Wales , thank you for your post, now i feel much better :D
but still, i assume this is gonna be a JS library, not only ajax .....

 Signature 
Profile
 
 
Posted: 12 November 2009 11:02 AM   [ Ignore ]   [ # 43 ]  
Grad Student
Avatar
Rank
Total Posts:  32
Joined  04-18-2006

I’m partial to leaving it to the developer to pick their own library, but if there were to be a default integration, I’d pick jQuery. jQuery seems to be a very clear winner in popularity, being lightweight and feature rich by way of plugins. Why try to reinvent the wheel with a custom lib?

Also, Google AJAX libraries API makes it a breeze to install and maintain the more popular AJAX libraries.

 Signature 

http://www.motortopia.com/
http://www.huskerlocker.com/
http://www.phpinsider.com/

Profile
 
 
   
3 of 3
3