1.

Solve : Java Script Code That Triggers Open In New Window?

Answer»

or u WORKING with only javascript??you cant do the "IP" part with javascript+ database...


u will need to add all your ips in a database/textfile by using php(server side)...
whenever a new person comes...validate this new ip with your exisiting database value..
if it is not seen in the database, open page

in php u have a function known as header( instead of window.location...something LIKE this i forgot exactly....

else u can do this in javascript,

var [] array_list="";

var new_ip="";

for (int i=0;i{
 

for (int i=0;i{
    if (array_list.equals(new_ip))
   { window.location="a.html";
  }
}

sry...i havent worked with php nor javascript for ONE year...i have forgotten about the syntax...but the logic is here....and i guess u can understand it as ur a programmer as well....


u can use ajax as well to do it....

u cant extract ip from javascript....its impossible...

u can use java like applets to extract ip as well...
That is quite ok..You have helped me a great deal!! I wish I was a programmer lol,but I am LEARNING as I go along. Thanks again for your help!!Lina, please use the CODE tag when displaying code in your posts...

Code: [Select]// like this

Code: [Select]window.location = "URL HERE";
This just sends the user to a new URL in the same window they are currently looking at.

Code: [Select]window.open("URL HERE", "_blank", "width=300,height=200");
This opens a new window/tab with the specified URL. You can change the width and height if desired (in pixels).

Whether a new tab or window opens depends on the browser. I think IE opens new windows, Firefox opens tabs etc....there's no way to specify which one you want (I'm 90% sure).

To only display it once a day for each visitor is more complicated and involves using cookies to check the last time they visited the site. See Google.thx kpac...but where is the "code tag"...im not finding anything to help me show my codes...thanks beforehand Code: [Select][code ]Code[ /code]

without the spaces... Code: [Select] test ok thx



Discussion

No Comment Found