How can invisible one hyperlink window
How can invisible one hyperlink window
(OP)
Hi,
I want to run one of our websites on the background of my webpage, because I am using its result on my webpage, but I do not want it has been seen by users.
Here is my code:
-------------------
<button onclick="myFunction()">Click</button>
<script type="text/javascript">
function myFunction() {
var win = window.open("https://xxx.com", '1366002941508','width=80,height=20,left=1,top=200');
setTimeout(function () { win.close();}, ss);
}
</script>
--------------------
When I add "visible=none" to the window, "https://xxx.com" cannot be run, but I need it to be run on background, finally it will be closed after some seconds.
Also, I tried with frame, but I think we cannot run any webpage (like https://xxx.com ) on frame. I am really stuck:(
Does everybody have any idea about that?
I really appreciate your help.
RE: How can invisible one hyperlink window
Given that the sole purpose of the iframe element IS to allow external URLs to be displayed, you are incorrect.
AND if you do not want the page to be displayed to the user, WHY are you using an onClick event, which requires user interaction, to trigger it?
Chris.
Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
RE: How can invisible one hyperlink window
CODE
Though I wasn't expecting what I got when I tested it! - Is this a dodgy post?
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
RE: How can invisible one hyperlink window
Thanks for your answer. I just changed it to see the result, but it says " the content cannot be displayed in the frame" (please look at the attached file ):
-------------------------- Example --------------
<html>
<head>
<script>
function myFunction()
{
document.getElementById('myFrame').src='https://www.yahoo.com/';
}
</script>
</head>
<body>
<button onclick='myFunction()'>Click Me</button>
<iframe id="myFrame" style="width:800px;height:300px"></iframe>
</body>
</html>
---------------------------------
RE: How can invisible one hyperlink window
You most probably won't have this problem, if you allow your own website to be displayed inside a frame.
The error says: "...the publisher of this content...", which is yahoo, "does not allow it to be displayed in a frame".
So you can't display yahoo.co, in a frame, but you most probably can display your own content in a frame.
Bye, Olaf.
RE: How can invisible one hyperlink window
Do all browsers honour the meta setting for this?
CODE
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
RE: How can invisible one hyperlink window
Perhaps there may be a better approach to the whole issue.
Keith
www.studiosoft.co.uk
RE: How can invisible one hyperlink window
Chris.
Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
RE: How can invisible one hyperlink window
Ergo marjansayyad , if you use IE7 on XP, it won't be an issue
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
RE: How can invisible one hyperlink window
Yep! Situation normal, and by the time all browsers catch up, everything else will have moved on and it will be redundant :)
Chris.
Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
RE: How can invisible one hyperlink window
http://www.w3schools.com/ajax/ajax_xmlhttprequest_...
http://www.w3schools.com/ajax/ajax_xmlhttprequest_...
This is included much more elegantly to use in other javasctript libraries, eg jQuery.
Bye, Olaf.
RE: How can invisible one hyperlink window
Olaf, the W3Fools site was created for a reason : to throw attention to W3Schools problems. Better link to XMLHttpRequest on MDN or XMLHTTPRequest on MSDN.
For example the referred pages mention nothing about Cross-origin resource sharing. Due to Same-origin policy neither AJAX will be able to get content from the Yahoo! site, unless they explicitly allow it. ( My guess : they will not. )
Feherke.
feherke.ga
RE: How can invisible one hyperlink window
Besides, I also dislike w3schools, but to get the essential stuff you can pick up code from there, too.
The site where I learned HTML best was SelfHTML, mostly german and therefore only known in germany. I used english resources later on, but mostly for other things than HTML.
Bye, Olaf.
RE: How can invisible one hyperlink window
Correct, based on that sentence. Maybe would better to rephrase more generally :
The OP needs similar permission on the target server to alter either the X-Frame-Options or the Access-Control-Allow-Origin HTTP response header, as both has to be done on the target server. As X-Frame-Options can also be set in meta tag, while Access-Control-Allow-Origin not, (s)he has more chances with frame than with AJAX.
Feherke.
feherke.ga
RE: How can invisible one hyperlink window
Keith
www.studiosoft.co.uk
RE: How can invisible one hyperlink window
FYI, http://codingforums.com/javascript-programming/328...
Feherke.
feherke.ga
RE: How can invisible one hyperlink window
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
RE: How can invisible one hyperlink window
Thanks for all your answers. I am not professional in coding so, I decided to change my code. Now I want to run the new link in a new tab then close it after 2 seconds, and I want this new tab be opened once, but my problem is:
when I back from any lnk1,or lnk2, the www.xxx.com has been opened again. How can I fixed that?
Here is my code:
--------------- example--------
<html>
<body>
i=1
<table >
<tr><td > </td></tr>
<tr> <td >
<script type="text/javascript">
if ( i=1 ) {
var win = window.open("www.xxx.com", '_blank');
setTimeout(function () { win.close();}, 2000);
i=2
} </script>
</td> </tr>
<tr><td >lnk1 </td>
<td > lnk2 </td>
<td > lnk3</td>
<td > ... </td> </tr>
</table>
</body>
</html>
------------------
Thanks for your help!!
RE: How can invisible one hyperlink window
Bye, Olaf.
RE: How can invisible one hyperlink window
As per my previous question to the OP, what are you actually trying to achieve.
Sometimes you need to step back and look at the big picture rather than get bogged down by specific problems in developing a solution.
Keith
www.studiosoft.co.uk
RE: How can invisible one hyperlink window
Exactly, which is why I originally wrote
Which makes me wonder if they are trying to load a hidden porn site deliberately? Though abc or xyz aint a good idea either!
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music