Jump to content

Javascript Run At Server


mstransky
 Share

Recommended Posts

example, here is a js code that many have ask me for like five times a month it is a simple random image display of ads or buttons.you can have as many ads as you want, and z= "how many ads to hidealso if you want them to display vertical or horizontalthe line to change is thishorizontal displayrandomorder(adblock, '  ') for a vertical display change to thisrandomorder(adblock, '<br/><br/>')Reason I ask if one wishes to write a javascript to pull data from a database most people could just back track a websites "CSJS" client side Javascript route to important codes and files.Which ways can this be done? As far as I know asp and php would have to run to execute a script at the server to hide actual path locations. *** My question is this, say if you don't want someone to see your code how would you write this to be a javascript run at server? or does the standard CSJS have to be rewritten in asp or php.----------------------------------------it works have fun for free--------------------------<script LANGUAGE="JavaScript"> var adblock = new Array() adblock[0]='<a href="http://www.stransky-webdesigns.com/ads/120x60as1.jpg" rel="nofollow"><img src="http://www.stransky-webdesigns.com/ads/120x60as1.jpg" width="120" height="60" border=0 alt="Display alt text for 120x60as1" /></a>'adblock[1]='<a href="http://www.stransky-webdesigns.com/ads/120x60as2.jpg" rel="nofollow"><img src="http://www.stransky-webdesigns.com/ads/120x60as2.jpg" width="120" height="60" border=0 alt="Display alt text for 120x60as2" /></a>'adblock[2]='<a href="http://www.stransky-webdesigns.com/ads/120x60as3.jpg" rel="nofollow"><img src="http://www.stransky-webdesigns.com/ads/120x60as3.jpg" width="120" height="60" border=0 alt="Display alt text for 120x60as3" /></a>'adblock[3]='<a href="http://www.stransky-webdesigns.com/ads/120x60as4.jpg" rel="nofollow"><img src="http://www.stransky-webdesigns.com/ads/120x60as4.jpg" width="120" height="60" border=0 alt="Display alt text for 120x60as4" /></a>'adblock[4]='<a href="http://www.stransky-webdesigns.com/ads/120x60as5.jpg" rel="nofollow"><img src="http://www.stransky-webdesigns.com/ads/120x60as5.jpg" width="120" height="60" border=0 alt="Display alt text for 120x60as5" /></a>'adblock[5]='<a href="http://www.stransky-webdesigns.com/ads/120x60as6.jpg" rel="nofollow"><img src="http://www.stransky-webdesigns.com/ads/120x60as6.jpg" width="120" height="60" border=0 alt="Display alt text for 120x60as6" /></a>'function randomorder(targetarray, spacing){var randomorder=new Array()var the_onevar z=2for (i=0;i<targetarray.length;i++)randomorder=iwhile (z<targetarray.length){the_one=Math.floor(Math.random()*targetarray.length)if (targetarray[the_one]!="_selected!"){document.write(targetarray[the_one]+spacing)targetarray[the_one]="_selected!"z++}}}</SCRIPT><p><script type="text/javascript">//<![CDATA[randomorder(adblock, '  ')//]]></script> </p>

Link to comment
Share on other sites

javascript is client-side.php is server-side.Ajax is using javascript to call a php script without a full page refresh.Are you asking about Ajax?
I wrote a number of javascripts to act like adsense across a few sites sharing each others banners, then did not like how a person could just view source and see who is in the setup and what sites are uses the scripts. So I went out of my way doing it in asp and xml banner manager counting impressions and clicks per site showing the ads from other sites and stuff. Since then I have been turned to look at doing/trying php and to go back and rewrite all my asp stuff. As i was looking into how javascript has progress I read a few articles which talked about"CSJS" client side"SSJS" server side"CORE JS"and coming is "JS.NET"I figured that some kind of like server side javascript can/or coming which would allow server side js to run and compile tasks before rendering it to the client side output.I was just getting some upto date kind of insight from the boards being I had my head force under water for some time now. Its kind of a wake up call to reality and I feel I missed out on what languange I should have been programming in the first place.I kind of want to get on the right band wagon this time.
Link to comment
Share on other sites

If you've been using ASP, you can switch from VBScript to Javascript for the server-side execution.Here's an example: http://www.tizag.com/aspTutorial/aspJavascript.php
Yeah I was wondering if I was to try redoing all my asp codes into php, then thought about js and seen and article about Asp.net, also the php could be done likewise, then saw js.netWhen I saw that I thought there might have been a js server side execute to do js on the server before rending the about without giving up the code in "View Source". It was just a questions out there on a limb.
Link to comment
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
 Share

×
×
  • Create New...