GithubHelp home page GithubHelp logo

ajaxboy / cjax Goto Github PK

View Code? Open in Web Editor NEW
66.0 66.0 27.0 1.93 MB

Lightweight Ajax Framework built in PHP with no foot-print. Allows you to build ajax functionality with a single line of code & do so much more, right from the back-end!

Home Page: http://cjax.sourceforge.net/

PHP 29.25% CSS 10.80% JavaScript 49.70% HTML 10.18% Hack 0.07%

cjax's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cjax's Issues

bind new bottons

after an cjax call and update a div, the response create new bottons on the html loaded, is there any way to bind this bottons to a cjax call and fire it on any trigger like onClick but only when the user want it.
the on() method is usable if i want to fire it inmediatly after a success cjax call. but limited mostly to messages an some others but not usefull for interaction with the server.

For Example: create a select depending on selected option of a parent select; and show a form with it's text-fields, checkboxes, selects validated and submited with cjax.

Can I do it with cjax?, I hope so because this is an incredible framework.

thanks in advance for your answer.

ajaxVars

can you tell me please how ajaxVars method can be used?

Multiple issue during install - is script still up to date ?

While trying to install the script, I first unzipped the content, without making any changes.
Opened http://yoursite.com/ajax.php?test/test and got a first error :

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ajax has a deprecated constructor in www\cjax\cjax\ajax.php on line 40

So I changed the line to : function __construct($controller)

and also opened file cjax/config.default.php and renamed it to config.php and changing the line below:
$config->js_path = '/cjax/cjax/core/js/';

And now :
if I open the post.php example, I get the following errors:

cjax.js:4215 Refused to set unsafe header "Content-length"
cjax.js:4220 Refused to set unsafe header "Connection"

if I open the send_form.php example, I get the following error :
/cjax/cjax/core/js/cjax.js.php?preload=0.7793850871390129:1 Uncaught SyntaxError: Unexpected token <

etc.

so I am wondering :
1- is the script still up to date in terms of security and PHP guidelines ?
2- what changes are needed in order to make it work ?

thanks a lot for your time ! I really think it's a powerfull framework looking at the examples !

Problem with CJAX Controllers location

I tried to set the controllers location from the default /controllers to /controller/viewcontroller. But it will not work, I used this code: define('AJAX_CD', 'controller/viewcontroller'), but CJAX stops functioning. I thought it should be possible to change controller locations, or is this feature removed in recent releases? Or am I doing something wrong?

Responders and the CI framework

I have a whole load of models and other important business and database logic in the usual places in CI. Your CJAX thing is supposed to provide the existing framework with AJAX access right?

The way I have things set up currently - following your examples - is a folder called responses which has a file called login.php and a class called login all the logic for it is still in a model. Surely I would be better of using a controller?

In a response class I have no access to the Codeigniter framework which leaves CI mostly way out in the cold. So (1) CI is mostly pointless or (2) CJAX is just for pretty stuff but can't handle the heavy lifting of a real AJAX system or (3) you fully intended for CJAX and CI to work together and have been keeping this a secret.

So I do not have to spend the next two days reinventing the square wheel what is the process you intend or suggest to allow access to CI framework tools and helpers? At the moment response classes look more like really crap imitations of controllers.

Tell me I'm wrong but this really looks like it's been hacked onto CI in a way that ignores everything about CI that makes it worth using rather than designed to work within it.

Is this still being worked on?

Hi there, I dont want to be pessimistic, but it has been almost a year since the last release of CJAX. I wonder though, is this project still alive? Or are you planning something big like CJAX 6.0?

Documentation: you need some

Progress using CJAX has been painfully slow because what is actually expected in a normal production environment is not even hinted at. Yes the examples are very nice but an example of using a view to output the page... Actual examples of how to get going even if that example is just hello world would have saved me hours of frustration.

An important issue with CJAX Plugins(naming of js function)

By default, CJAX plugin system requires you to create a js file with the function name to be the same as the plugin name(API name). For instance, there is a function upload() in upload plugin, and a function validate() in jquery validate plugin. This allows users to use ajax syntax such as $ajax->upload() and $ajax->validate().

However, there is a serious drawback with this approach, that it may suffer naming conflicts with third party libraries. This can result in the third party library's functions being overriden, and bugs that are hard to detect or debug.

As I am working on the plugin dragula right now, I find there is a dragula() function in the library for dragula. This wont be a problem for most jquery libraries though, but for libraries that use vanilla javascript, its highly possible to have such naming conflicts.

I am forced to rename the plugin to dracula then(otherwise defining a dragula() function will destroy the one from the third party library), to avoid naming conflicts. However, it may not be an ideal solution, as the API now becomes more confusing. I believe there's gotta be a better way to do this. Maybe, we can have a different naming convention for the js function? Maybe use prefix CJAX or suffix Plugin then? What do you think?

Installing cjax-5.9-RC8

I downloaded cjax-5.9-RC8, extracted the contents and visited http://localhost/cjax/ajax.php?test/test and the cjax installs succesfully
screenshot from 2017-02-27 12-57-24

The problem is when I merge the installation with Codeigniter and run my system, I get
screenshot from 2017-02-27 13-04-30

I also get the same issue when I try installing after merging cjax and Codeigniter.

after successfull installation not working

after installed and rename the config.default.php to config.php, assigned the js, directory to $config->js_path, it works perfectly, but it is not workink with other directory name.

Renamed the examples dir to any name and stops working correctly.

the coockie still continue with "examples%2Fcontrollers" and may be this is the reason.
AJAX_CD | examples%2Fcontrollers | localhost | .....
how can i fix it?

i'm testing cjax in localhost.

any help is wellcome. thanks in advance.

Inheriting CI_Controller

The controllers in Beta 1 release version 6.0 can not inherit the CI_Controller class of CodeIgniter.

I am developing an application using version 5.8, and this is possible there. Because the CJAX controllers in version 5.8 can inherit CI_Controller class of CodeIgniter, I can load my CodeIgniter models and libraries into the CJAX controllers and reuse the code in the models and libraries.

I have tried this in the Beta 1 release of version 6.0 and found it is not possible.

Developing CJAX 6.0

I am actually developing a new branch/version of CJAX myself right now, since I want to introduce some changes to the script, add more features and modernize it to be compatible with later versions of PHP without having to turn off strict standard errors and etc. Is it allowed for me to share the file changes once I finish it? Or can I make a pull request after it is done? Can I call it CJAX 6.0 then?

Mouse events?

Hi there, I wonder if mouse events like onmouseover, onmousedown are already possible with CJAX. If not, do you have plans to add them within 1-2 years? I wonder how easy/difficult it is to create a javascript event though, I can give a try myself if it is not so complicated. Thx.

Installing Problem

When i open the Test Page: http://localhost/ajax.php?test/test


Fatal error: Class 'CI_Ion_auth' not found in C:\MAMP\htdocs\system\core\Common.php on line 196

A PHP Error was encountered

Severity: Error

Message: Class 'CI_Ion_auth' not found

Filename: core/Common.php

Line Number: 196

Backtrace:

path to cjax.php

I dont know why the Compiler is looking for 'cjax.php' in 'cjax/' instead of where it is in 'cjax/core/'. Please help. I am testing Version 6.0 beta 3. The error message is below.

A PHP Error was encountered

Severity: Compile Error

Message: require(): Failed opening required '/home/baba/lampstack-5.6.22-0/apache2/htdocs/examsystem/cjax/cjax.php' (include_path='.:/home/baba/lampstack-5.6.22-0/php/lib/php')

Filename: cjax/autoloader.php

Line Number: 40

Backtrace:

JQuery version

I got this:
cjax.js:4739 Uncaught TypeError: jQuery.ajaxSetup is not a function
at Object.CJAX_FRAMEWORK.onStartEvents [as fn] (cjax.js:4739)
at :9:11
at r (cjax.js:4670)
at :1:1

Is there a Cjax incompatible JQuery version? If so, which one? this is what i am currently using with bootstrap 4.6. how can I make them work together? or what's the recommended JQ version to work with.

thanks in advance

onsubmit event

  1. i saw in examples that form can be submitted via click event of button. it's not perfect method since we might loose other ways (such as hitting enter on form) - am i right?
    is there onSubmit way to interfere with form via cjax?

  2. i want to create dialog ui windown and load content into it with cjax scripting. is there way to do it - can you help me?

Integration

Hi, do you have sample for laravel usecase?

overlay not working in cjax-5.9rc3b

The overlay API is not working for me. When I try the overlay, I get the error message
"Error: File not found filename/param1/param2"

But the same arguments/parameters work perfectly when I pass them to the location API.

Overlay had had been working for me with the same code in CJAX-5.8
PS: Am using cjax with CodeIgniter 3.x

Time to remove PHP 4 Syntax?

Well as of CJAX 5.5 I still see PHP 4 syntax like this:

class ajax{
function ajax($controller){
...
}
}

PHP 4 is way outdated and no modern software should be compensating for this old dinosaur. Dont you think its about time to move on, and remove all PHP 4 stuff in the next version? After all, the latest version is already made compatible with PHP 5.4, so its definitely getting there.

Overlay + Tab Support?

Cjax is a great Ajax Framework ๐Ÿ‘
But, i miss a Tab-Tool or Demo :)
Have any a Idea for Overlay + Tab?

Thanks

Conflict with CI Session library

I am integrating CJAX-5.9-RC8 with my app running on CI-3.1.3. I've found that CJAX is working great, except when I load Codeigniter's Session library. With this library loaded, CJAX doesn't seem to work at all - no responses, no errors, nothing.

The CI Session library has changed substantially since 3.0, and the docs even mention the potential affects on AJAX requests.

I'm wondering if there are any known issues with CJAX-5.9 conflicting with the new Session library, and what I might do to get them to play nicely together.

Exec function

I have a website with a sidemenu with a cjax click (Exec) attached that loads a controller (CodeIgniter) which loads a view on the content part. This content has a button with another click(exec) event attached to it like the first one but when i click it, it does not fire the event. In your cjax.class Exec function, you have this comment below:
//some functions return the ajax object?
this is the same part where the issue occurs.

In my point of view, it seems the the later Exec function is not added the the _EventCache according to firebug.

How is development of CJAX going?

Well I made a few suggestions for CJAX 6.0 in my last post, and the owner of CJAX seemed interested. I wonder though, is the new major version under development? Or maybe a new minor 5.x version is in the making? I do think there are many things we can do to make CJAX more powerful, it can grow to support more events and make everything easier. If the lead coder of CJAX needs more advice for a future 6.0 release, I can give my two cents here, although I've said enough in another post and maybe it will be too many new features to work on?

is it possible to write the controllers path on the ajax call

It is possible to write the controllers path on the ajax call ?

something like this : $ajax->call('path/to/directory/controller/method').
or
$ajax->click("btnSubmit",$ajax->form("ajax.php?path/to/directory/send_form/submit_form"));

regards and thanks for your help

and last but not least...
can I change the apearance of the messages? size? border, place to show it, ect.

Update TableRow/TableCell doesn't work

it's impossible to update a TR or TD, since they have no "value"-Property, only "innerHTML".

To fix that, in function "this.property" (file ax/core/js/cjax.js), just put something like

                            case 'TR':
                                    element.innerHTML = value;
                                    break;
                            case 'TD':
                                    element.innerHTML = value;
                                    break;
                            default:
                                    console.log("element.value = " + element.value);
                                    element.value = value;

(the default is already in the file, around line 400)

Drag and Drop support?

Hi there, I wonder if Drag and Drop AJAX support will be considered added to CJAX in near future. I know it is not a small/easy thing to ask, but still curious. Thx.

Suggestion for CJAX 6.0

Hi there, it seems to have been quite a while since the last release of CJAX 5.7. I have some ideas for how CJAX 6.0 may look like, assuming this is being worked on.

  1. Namespace usage: I think it is about time to move on to PHP 5.3+ and drop PHP 5.2 support, because namespace is awesome to use. Nowadays most webhost provides PHP 5.3 or 5.4 servers, so its really no need to compromise for old PHP users.
  2. Mouse events: I dont think mouse events are already in CJAX, I brought up the idea before and the developer seems to be interested in looking at it for future releases. So how about in CJAX 6.0? The events such as onMouseDown and onMouseOver can be quite useful.
  3. Drag and Drop: I also made a suggestion about drag and drop before, it seems that there is already a functionality $cjax->drag but it just doesnt do the job yet. Maybe in version 6.0 drag and drop will be in full action? or perhaps as a plugin?

So these are what I can come out with, if the next version is being worked on now will it be feasible to expect release someday in 2015? Or will there not be a major release any longer?

../cjax.js file not found error message

Hi. need help installing Cjax. while I'm on it, i got this messages all the time in the browser.

Not Found
The requested URL /AppServ/www/deliberiusSF/cjax/core/js/cjax.js was not found on this server.
localhost//SITE?test/test2 -->the browser displays a blank page

SOLVED:
just rename config.default.php to config.php and
gave the $config->js_path in this file the path to the cjax.js file ('/mySite/cjax/core/js/').

but now FF says:
Uncaught TypeError: jQuery.ajaxSetup is not a function
at Object.CJAX_FRAMEWORK.onStartEvents [as fn] (cjax.js:4739)
at :9:11
at r (cjax.js:4670)
at :1:1

may you help?

Thanks.

CJAX only works if accessing file in the same directory as ajax.php

Well I am trying to build a website that uses pretty URLs(or search-engine friendly urls), in which old urls such as /profile.php?user=1 becomes /profile/user/1. But it seems that if I have more than one forward slashes in the request URI, CJAX will stop working. I believe CJAX assumes that each forward slash means a directory separator, so the javascript include path is messed up. I notice that if I move a php file to a subdirectory, rather than in the same directory as ajax.php, it will also make CJAX stop functioning. Now the question is, how can I fix this?

how to call a method from...

Hi cjax boy, is it possible to call a method/function from inside a javascript function? if so, how is it?

regards

Godaddy Cjax not responding

i used this plugin to pull a simple ajax request to update my notification table.i was testing my application on justhost.com and local host and it worked just fine but when i launch it and move to godaddy it does not work ,please help me as of possible causes of this.i just use it just once in this line of code.

$(document).ready(function(){
$('#achor1').click(function(){
$.get('ajax.php?test/test/Hello', function(response) {
})
});
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.