Hash variables - server-side and client-side

Hash variables - server-side and client-side

Postby jegalink » Thu Jun 02, 2016 1:02 am

I have a conceptual question about hash variables after reading all the wiki documentation on hash variables and functions:

I understand that when hash variables are used in fields, php scripts, etc - they are replaced by the corresponding hash values before anything is run or interpreted. I'm assuming that all happens server-side when a form or other event is submitted by the client to the server. However, the nuSetHash() function is javascript, which is client-side functionality, right? So does that only set the value of the hash variable for the client? How does that get handed back to the server so it can be used in whatever form or output that comes next?

Thanks!
jegalink
 
Posts: 16
Joined: Tue Feb 10, 2015 2:47 am

Re: Hash variables - server-side and client-side

Postby admin » Wed Jun 08, 2016 10:38 am

jegalink,

If you ran this in javascript (on the client side).

Code: Select all

   nuSetHash('new_color','red');



if you then had a hash variable in the php code On Save eg.

Code: Select all

   if ('#new_color#' == 'red'){

      doSomething();

   }



creating..

Code: Select all

   if ('red' == 'red'){

      doSomething();

   }



Steven
admin
Site Admin
 
Posts: 3348
Joined: Mon Jun 15, 2009 9:53 am


Return to General