User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion

Reply
Thread Tools Display Modes
Unread 13 Mar 2007, 12:11   #1
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
Question question about java script

Given the vast number of threads in this forum I dont think there someone here who can help me, but I'll try anyway. I don't know much about java script, so atm im trying to copy whatever I need from various sources. Now my Problem is this:
There are two websites on two different servers. If the users clicks on a button on Website A a popup window with content from website B opens. The code looks something like this:

<html>
<head>
<title>My File Browser</title>
<script type="text/javascript">

function SelectFile( fileUrl )
{
window.opener.SetUrl( fileUrl ) ;
window.close() ;
}
</script>
</head>
<body>
<a href="java script:SelectFile('File1.jpg');">File 1</a><br />
<a href="java script:SelectFile('File2.jpg');">File 2</a>
</body>
</html>

In this window the user is supposed to click on a link. After doing so some value is to be put in an input field in website A and website B is to be closed.
Now this all works perfectly fine as long as both websites are on the same server. Unfortunatly the whole point of me doing this is because they are not Is there any easy way to make this work? I just need some way to put a filename into an input field
__________________
im not tolerant, i just dont care.
wu_trax is offline   Reply With Quote
Unread 13 Mar 2007, 19:45   #2
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
Re: question about java script

I think the browser prevents you from doing such trickery. This seems like a pretty nice way to implement a phishing site. But I'm no expert on this security stuff so I might be wrong.

Alternatively, if you have a PHP webserver running, you can load the other website as a file, and render the HTML in your little window that would be opened locally.
- open little window on server A
- little window opens remote website B using a script (fopen("http://mywebsite.com"))
- little window renders website B's html as-is and does javascript stuff

It's a nasty solution, but if you "just need a way to put a filename into an input field" it should do the trick.
__________________
"Yay"
Structural Integrity is offline   Reply With Quote
Unread 14 Mar 2007, 00:01   #3
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
Re: question about java script

thanks a lot, that woks.
__________________
im not tolerant, i just dont care.
wu_trax is offline   Reply With Quote
Unread 16 Mar 2007, 16:02   #4
Shyne
Flash in the PAN
 
Join Date: Aug 2005
Location: Birmingham, Romania
Posts: 554
Shyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud of
Re: question about java script

Its javascript, not java script, and using javascript as an anchor target is BAD BAD BAD.

What happens to your users without javascript ?
Shyne is offline   Reply With Quote
Unread 16 Mar 2007, 19:53   #5
Phil^
Insomniac
 
Phil^'s Avatar
 
Join Date: May 2003
Posts: 3,583
Phil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus would
Re: question about java script

open website b with a parameter in the url which you want to pass to website b, like http://websiteb/index.html?user=one
this website rewrites its urls ( using javascript if you really want, but serverside tech is preferred ) so that this parameter is included in the link to website a, along with something added there.
like : http://websitea/page.html?user=one&var=something
Grab variables from the http get request and process accordingly
__________________
Phil^
Phil^ is offline   Reply With Quote
Unread 16 Mar 2007, 21:25   #6
Structural Integrity
Rawr rawr
 
Structural Integrity's Avatar
 
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
Structural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriendStructural Integrity needs a job and a girlfriend
Re: question about java script

Quote:
Originally Posted by Shyne
Its javascript, not java script, and using javascript as an anchor target is BAD BAD BAD.

What happens to your users without javascript ?
They should get a decent browser.
__________________
"Yay"
Structural Integrity is offline   Reply With Quote
Unread 16 Mar 2007, 21:59   #7
Shyne
Flash in the PAN
 
Join Date: Aug 2005
Location: Birmingham, Romania
Posts: 554
Shyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud ofShyne has much to be proud of
Re: question about java script

That's not really an acceptable answer !

While I agree about the capability of javascript, you're cutting off 10% of users who think you're shit because your site doesn't work. They don't see it as their fault !

As Phil suggested, javascript is neither necessary nor the right solution here.
Shyne is offline   Reply With Quote
Unread 17 Mar 2007, 15:46   #8
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: question about java script

I hate links that use JavaScript at all.

See www.rswww.com. I do a lot of electronics part ordering from them but because pretty much every link on the site is a JavaScript one it's entirely incompatible with tabbed browsing. ****s.
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 17 Mar 2007, 17:11   #9
Androme
☆ ♥ 
 
Androme's Avatar
 
Join Date: Jan 2003
Posts: 3,489
Androme can only hope to improve
Re: question about java script

pab - you can get a greasemonkey script to parse all javascript links into normal links - the latest version of noscript also happens to have this nifty feature
__________________
R3: LegioN (came #32) || R4: BlueTuba
R5: WolfPack Order || R6: Wolfpack
R7: Fury
----------retired-------
R52-R55: Apprime
R56-R57: FaceLess
R58-60: Apprime/Ultores
Androme is offline   Reply With Quote
Unread 28 Mar 2007, 19:30   #10
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
Re: question about java script

Quote:
Originally Posted by Shyne
Its javascript, not java script, and using javascript as an anchor target is BAD BAD BAD.

What happens to your users without javascript ?
so people actually post in this forum? who would have thought
anyway, this whole thing is for some specific people and we made it a requirment that they have javascript enabled, the website makes use of fckEditor, which uses javascript quite a lot, so the user would even get as far as clicking my link without it.
anyway i dont have time for this whole project right now
__________________
im not tolerant, i just dont care.
wu_trax is offline   Reply With Quote
Unread 28 Mar 2007, 19:48   #11
Phil^
Insomniac
 
Phil^'s Avatar
 
Join Date: May 2003
Posts: 3,583
Phil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus wouldPhil^ spreads love and joy to the forum in the same way Jesus would
Re: question about java script

I would suggest you change the site then so that navigation does not depend on javascript.
For one thing, it means webcrawlers can index your site better and thus will directly improve your search rankings in things like google, yahoo, msn search etc.
__________________
Phil^
Phil^ is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Forum Jump


All times are GMT +1. The time now is 06:40.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018