Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo/ Creating Plugins(+Javascript API +PHP API) Docs broken #20

Open
ajaxboy opened this issue Apr 12, 2016 · 3 comments
Open

Demo/ Creating Plugins(+Javascript API +PHP API) Docs broken #20

ajaxboy opened this issue Apr 12, 2016 · 3 comments

Comments

@ajaxboy
Copy link
Owner

ajaxboy commented Apr 12, 2016

The documentation for Demo "Creating Plugins(+Javascript API +PHP API)" appears to be broken and only shows partial information, while there is much more info than the one that appears.

Link:
http://cjax.sourceforge.net/examples/plugins.php

@HallofFamer
Copy link
Contributor

HallofFamer commented Apr 15, 2016

@ajaxboy

I was able to fix this problem in CJAX 6.0 Beta 1(will be available soon). The issue is with the method CoreEvents::jsCode(), specifically this line:

$data =  "<script>". highlight_string("\n" . $data ."\n");

As you can see, the code wraps data inside script tag, but it only adds an opening script tag, without a closing script tag. For this reason, calling method jsCode() will render the rest of lines to be javascript, effectively messing up the HTML of a page.

To fix this issue, simply change this line to:

 $data =  "<script>". highlight_string("\n" . $data ."\n")."</script>"; 

And the creating plugins page should appear normally, as it shows up on CJAX 6.0 Beta's demo site:
http://mysidiarpg.com/site/cjax/cjax600b1/examples/plugins.php

@ajaxboy
Copy link
Owner Author

ajaxboy commented Apr 15, 2016

Very nice. Thanks. That ought do it

@HallofFamer
Copy link
Contributor

You are welcome, I will make a push request for CJAX master branch regarding this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants