Jump to content
MakeWebGames

Recommended Posts

Posted

A while back i started work on making GLs pages load via AJAX, using the default theme you can enable this by editing the,es/default/loggedin.php and changing 

<!--<script src="themes/{_theme}/js/ajax.js"></script>-->
to 
<script src="themes/{_theme}/js/ajax.js"></script>

This script will turn all A tags into AJAX links as well as FORM tags.

It would be great if people can test and post any bugs they find here. I would advise agains testing this on a live running game.

  • Like 1
Posted (edited)

I activated it in my game, on my phone when I open the menu it does not close, I have to close it manually yes I see the new page

 

 

edit2: the prison and hospital page doesn't load for me, it only loads if I refresh the page

Edited by Glock1533
  • Like 1
Posted

[QUOTE]

This script will turn all A tags into AJAX links as well as FORM tags.

[/QUOTE]

Is there a way to disable certain links

Ex: link.php?noAjax=true ? Or by adding extra data to the <a herf

  • Like 1
Posted

yes you would do it like this

<a href="?page=test" data-not-ajax>Test</a>

<form method="?page=test" action="POST" data-not-ajax>
  ...
</form>

 

  • Like 1
  • Thanks 1
Posted
3 hours ago, Dayo said:

yes you would do it like this

<a href="?page=test" data-not-ajax>Test</a> <form method="?page=test" action="POST" data-not-ajax> ... </form>


<a href="?page=test" data-not-ajax>Test</a>

<form method="?page=test" action="POST" data-not-ajax>
  ...
</form>

 

Thanks. This is definitely needed information. 🙂

Posted

Yeah i will better document it later and also finish off the default template as i still need to do something for the timers not sure how yet tho

Posted (edited)
16 hours ago, Dayo said:

A while back i started work on making GLs pages load via AJAX, using the default theme you can enable this by editing the,es/default/loggedin.php and changing 

<!--<script src="themes/{_theme}/js/ajax.js"></script>--> to <script src="themes/{_theme}/js/ajax.js"></script>



<!--<script src="themes/{_theme}/js/ajax.js"></script>-->
to 
<script src="themes/{_theme}/js/ajax.js"></script>

This script will turn all A tags into AJAX links as well as FORM tags.

It would be great if people can test and post any bugs they find here. I would advise agains testing this on a live running game.

 

@Dayo ... those two lines are identical, typo??

 

Ok, all good ... your suggesting that line be uncommented, cheers. 🙂

Edited by CrazyElk
  • Haha 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...