Hurdock

Alternative for windows.location !

Recommended Posts

Hurdock    1

It is awesome that we can use html things inside the server but the problem is...

 

- Is not nice that it has to 'refresh' the page too load the html code. For example:

	"vehicles": (player, args) =>
	{
		player.outputChatBox("<script>window.location.href = 'http://localhost/ragemp/vehicles/index.html';</script>");
		player.outputChatBox("<font color = 'gray'>Server:</font> Press F1 to see the list of available vehicles now.");
	},

The windows location href will stop the next outputchatbox to show up. So yeah, is kinda useless to 'load menus' if they aren't in same 'window'.

Is there any 'fix' i'm missing here or is a well known bug ?

Share this post


Link to post
Share on other sites

You can use react/vue.js/angular2/inferno/preact/mithril to create the frontend interface with cef.  You don't use redirects...

https://infernojs.org would be a great candidate for a fast interface. A JS library like inferno/react/vue allows you to update elements on the page instantly and organize them into components. (extremely useful because you can have a chat component, a button component, a dialog component...)

Even jquery with $.ajax would be a solution. Also if you want to offload the chat from the server you could use redis channels.

Edited by Vladimir Ilich

Share this post


Link to post
Share on other sites
Dominik48    0
В 15.03.2017 в 02:38, Vladimir Ilich сказал:

You can use react/vue.js/angular2/inferno/preact/mithril to create the frontend interface with cef.  You don't use redirects...

https://infernojs.org would be a great candidate for a fast interface. A JS library like inferno/react/vue allows you to update elements on the page instantly and organize them into components. (extremely useful because you can have a chat component, a button component, a dialog component...)

Even jquery with $.ajax would be a solution. Also if you want to offload the chat from the server you could use redis channels.

Thanks, I've been looking for this!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.