Script showing different data based on which site user is

Closed
Tobruk Posts 9 Registration date Thursday February 6, 2014 Status Member Last seen February 9, 2014 - Feb 7, 2014 at 12:29 PM
 Blocked Profile - Feb 7, 2014 at 08:21 PM
Hi.

Is there a way to write down a script (ya know, between <script></script>), which choose what data show - based on which site the user is?
I mean...

user A is on site .../A.html --> and the script shows A's data
user B is on site .../B.html --> and the script shows in turn B's data.

I know that's strange need but I must have this for my front widget in Wordpress. The widget on every site shows the same data and I can't change it by simply making two different widgets on two sites - it's implausible.

Pls help.



1 response

Blocked Profile
Feb 7, 2014 at 07:13 PM
Tobruk,

Those are server side produced. What that means, is the server can ask the client all sorts of cool stuff, and then based on a logical set of instructions, PRODUCE a specific Page/Link/URL/download listing based on O/S, for that user.

A widget, is the same thing, but on a "third party platform".

You must remember, you have to design your product to be used by 100% of the people, and if I have my scripting turned off my browser, your <script> won't work on my client, as it is read by the client, and performed by the client. A server side script is capable of changing the HTML code based on different logic of the user(client in this example).

But then again, what do I know!

--
"If you can't soar with the eagles, then don't fly with the flock!" - Oliver Sykes; Bring Me The Horizon
0
Blocked Profile
Feb 7, 2014 at 07:32 PM
SO you could really do something like:
<%IF request("admin")="employee" then%>
<!--#include file="employeeheader.txt"-->
<script src="\common\vip\VIPcommon.js" type="text/javascript" language="javascript"></script>
<%ELSE%>
<!--#include file="vistorheader.txt"-->
<script src="\common\common.js" type="text/javascript" language="javascript"></script>
<%END IF%>

NOTICE the differences based on the VARIABLE of the return of REQUEST("ADMIN")!
0
Blocked Profile
Feb 7, 2014 at 08:21 PM
Better example....

<script language="javascript">
<!--
function closeit() {

window.opener.location.href=window.opener.location.href + "<%=thevariable%>";

window.close();

}
-->
</script>
0