Hello everyone, i am currently working on a website and I need to make a chat application for it (as seen on some other questions i posted, haha)
Anyway, the gist is that I now have my website (on localhost for the time being), and my chat application. Now i need to make a button which, on click, will open the chat webpage in a pop-up window. I can do this easily with the following code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function AlertCC()
{
window.open("http://localhost/chat/node/1", "MyWindow", "height=520,width=560,scrollbars=no");
}
</SCRIPT>
</HEAD>
<BODY>
<CENTER><FORM><INPUT TYPE="BUTTON" VALUE="Open Chat Room" onClick="AlertCC()"></FORM></CENTER><p>
My problem is in the part of the:
window.open("http://localhost/chat/node/1", "MyWindow", "height=520,width=560,scrollbars=no");
wherein when I click the button, the page http://localhost/chat/node/1 will be opened in a pop-up window. This works well IN MY MACHINE with my localhost. However, whenever I run this on some other computer on the network through localhost, it opens the pop-up window (as expected) and does not navigate to the url. Based on some investigations I did, it basically looks for the native localhost (the localhost of the computer) and not into my localhost where the core files are located. I have options of changing my pop-up window opener code but I can't seem to find any other options than this one.
Can anybody please tell me how I will be able to fix this? Thanks a lot :)