Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 07-06-2005, 12:36 AM   #1
Solid State Member
 
Hellfire's Avatar
 
Join Date: Apr 2005
Posts: 15
Send a message via AIM to Hellfire Send a message via MSN to Hellfire Send a message via Yahoo to Hellfire
Default Javascript Script execution problem

Sry I havent been active for a while, been busy with some stuff.
A friend of mine has ran across a Javascript fucntion, but it wont seem to work
Code:
<script type="text/javascript" src="stats_screen.asp?Screen_Size='document.write(getscreensize())'"></script>
Anyone know the problem? Help is greatly appreciated thank you!
__________________

Hellfire is offline   Reply With Quote
Old 07-06-2005, 04:50 AM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,003
Default Re: Javascript Script execution problem

I tried to debug this, but I'm missing your get screen size function!!

I imagine this works though, else you'd have posted the souirce here...

just for the sake of sanity though...

try to write
Code:
<script>
document.write(getscreensize());
</script>
in place of your current script, see if you get the expected result printed to the screen...

all I can suggest after that is that you try to put the variable you are returning from the function into a named variable...
__________________

root is offline   Reply With Quote
Old 07-07-2005, 01:31 AM   #3
Solid State Member
 
Hellfire's Avatar
 
Join Date: Apr 2005
Posts: 15
Send a message via AIM to Hellfire Send a message via MSN to Hellfire Send a message via Yahoo to Hellfire
Default

Here is the Get Screen size funtion code
Code:
<script language="javascript" type="text/javascript">
<!--
function getscreensize() {
if (self.screen) {     // for NN4 and IE4
        width = screen.width
        height = screen.height
// Testing this first prevents firing the slow Java of NN4
}
else if (self.java) {   // for NN3 with enabled Java
       var jkit = java.awt.Toolkit.getDefaultToolkit();
       var scrsize = jkit.getScreenSize();       
       width = scrsize.width; 
       height = scrsize.height; 
}
else{
 width = height = '?' // N2, E3, N3 w/Java off, probably Opera and WebTV
}
document.write(width +"x"+ height)
}
<!--document.write(getscreensize())-->
// -->
</script>
Hellfire is offline   Reply With Quote
Old 07-11-2005, 05:59 AM   #4
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,003
Default Re: Javascript Script execution problem

document.write(width +"x"+ height)

not sure but I think that is the problem, you are writting the variable to the screen, try returning it from the function instead of document.write...

perhaps somebody else can give a little advice on this as well.
root is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 03:54 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0