本文介绍了在新模板/ aready defined / window中打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在新模板窗口中打开一个链接:

< a onclick =" windowopen(''example.html'',''example''); retu rn false;

href =" http://www.example.com" target =" _blank"示例链接< / a>


点击示例链接会在新窗口中打开它

已保存template / site / called example.html

I am trying to open a link in a new template window :
<a onclick="windowopen(''example.html'',''example'');retu rn false;"
href="http://www.example.com" target="_blank"example link</a>

such that clicking on the example link will open it in a new window in an
already saved template/site/ called example.html

推荐答案



soluce 1:


< a href =" http:// www.example.com" target =" example" example link< / a>

soluce 2:


< a onclick =" window.open('''' ,''example'');"

href =" http://www.example.com" target =" example" example link< / a>


soluce 3:


< a onclick =" window.open( this.href); return false;"

href =" http://www.example.com" example link< / a>

我不明白:在模板中打开一个html文件。


一些软件可以帮助用模板创建一个新的html文件。

php中的想法:



-

Stephane Moriaux et son(moins)vieuxMacdéjàdépassé

Stephane Moriaux和他的(旧)Mac已经过时

soluce 1 :

<a href="http://www.example.com" target="example"example link</a>
soluce 2 :

<a onclick="window.open('''',''example'');"
href="http://www.example.com" target="example"example link</a>

soluce 3 :

<a onclick="window.open(this.href);return false;"
href="http://www.example.com"example link</a>
I do not understand : open a html file in a template.

Some softs can help to create a new html file with a template.
Idea in php :
http://dosimple.ch/articles/Template...ate.class.phps

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date




我的意思是说我有动画

animation.swf


和我想以新的方式打开它窗口,但不是一个_blank窗口,一个窗口

我已经制作了我的徽标和文字,中间我想要

动画展示,我明白了我可以创建一个网页叫它

template.html并有一些文字标题等但我很困惑如何在这个页面中显示

这个动画作为弹出窗口

I mean lets say I have an animation
animation.swf

and I want to open it in a new window, but not a _blank window, a window
that I have already made that has my logo and text and in the middle I want
the animation to show, I understand I can just create a webpage call it
template.html and have some text title e.t.c but I am confused how I show
the animation in this page as a popup




我的意思是说我有动画

animation.swf


,我想在一个新窗口中打开它,但不是一个_blank窗口,一个窗口

我已经制作了有我的徽标和文字的中间我希望

要显示的动画,我明白我可以创建一个网页叫它

template.html并有一些文字标题等但我很困惑我怎么显示

动画n在此页面中作为弹出窗口


I mean lets say I have an animation
animation.swf

and I want to open it in a new window, but not a _blank window, a window
that I have already made that has my logo and text and in the middle I want
the animation to show, I understand I can just create a webpage call it
template.html and have some text title e.t.c but I am confused how I show
the animation in this page as a popup



让我们假设你的''template.html''你有一个div''内容'':


母亲页面代码:


< script type =" text / javascript">

var truc = false;

函数loadFlash(myFlash){

myFlash = myFlash.href;

if(truc&& !truc.closed)truc.close();

truc = window.open(''template.htm'');

truc.onload = function(){

var cible = truc.document.getElementById(''content'');

var flash = document.createElement(''OBJECT'');

flash.type =" application / x-shockwave-flash";

flash.data = myFlash;

flash.width ='''128'' ; //这里放正确

flash.height ='''128''; //宽度和高度

//你的瑞士法郎的参数:

flash.innerHTML =''< param name = movie value ="''+ myFlash +'' ">'';

//清空pop的div''内容'

while(cible.firstChild){cible.removeChild(cible.firstChild) ;};

//显示flash动画

cible.appendChild(flash);

truc.focus();

}

返回false;

}

< / script>


< a href =" bidule.swf" onclick =" loadFlash(this);"> bidule< / a>

< a href =" foo.swf" onclick =" loadFlash(this);"> foo< / a>


在打开新的swf之前不要关闭弹出窗口

(这里swf的大小相同)

Variante的大小:


< script type =" text / javascript">

var truc = false;

函数loadFlash(myFlash,w,h){

myFlash = myFlash.href;

if(truc&&!truc.closed)truc.close();

truc = window.open(''template.htm'','''','''width = 600,身高= 55 0,''+

''resizing = 1,scrollbars = 1'');

truc.onload = function(){opener。华而不实(myFlash,w,h);};

truc.focus();

返回false;

}

函数浮华(myFlash,w,h){

var cible = truc.document.getElementById(''content'');

var flash = document。 createElement(''OBJECT'');

flash.type =" application / x-shockwave-flash";

flash.d ata = myFlash;

flash.width = w; //这里放正确

flash.height = h; //宽度和高度

//你的瑞士法郎的参数:

flash.innerHTML =''< param name = movie value ="''+ myFlash +'' ">'';

//清空pop的div''内容'

while(cible.firstChild)cible.removeChild(cible.firstChild);

//显示flash动画

cible.appendChild(flash);

}

< / script> ;


< a href =" bidule.swf" onclick =" loadFlash(this,128,128);"> bidule< / a>

< a href =" foo.swf" onclick =" loadFlash(this,360,240);"> foo< / a>


未经测试...


- -

Stephane Moriaux et son(moins)vieuxMacdéjàdépassé

Stephane Moriaux和他的(较少)旧Mac已经过时

Let''s suppose in your ''template.html'' you have a div ''content'' :

Code in your mother page :

<script type="text/javascript">
var truc = false;
function loadFlash(myFlash) {
myFlash = myFlash.href;
if(truc && !truc.closed) truc.close();
truc = window.open(''template.htm'');
truc.onload = function() {
var cible = truc.document.getElementById(''content'');
var flash = document.createElement(''OBJECT'');
flash.type = "application/x-shockwave-flash";
flash.data = myFlash;
flash.width = ''128''; // here put correct
flash.height = ''128''; // width and height
// params of your swf :
flash.innerHTML = ''<param name=movie value="''+myFlash+''">'';
// empty the div ''content'' of popup
while(cible.firstChild) {cible.removeChild(cible.firstChild);};
// display the flash animation
cible.appendChild(flash);
truc.focus();
}
return false;
}
</script>

<a href="bidule.swf" onclick="loadFlash(this);">bidule</a>
<a href="foo.swf" onclick="loadFlash(this);">foo</a>

The popup has not to be closed before to open a new swf in it
(Here sizes of these swf are same)
Variante with sizing :

<script type="text/javascript">
var truc = false;
function loadFlash(myFlash, w, h) {
myFlash = myFlash.href;
if(truc && !truc.closed) truc.close();
truc = window.open(''template.htm'','''',''width=600,height=55 0,''+
''resizing=1,scrollbars=1'');
truc.onload = function(){opener.flashy(myFlash,w,h);};
truc.focus();
return false;
}
function flashy(myFlash,w,h) {
var cible = truc.document.getElementById(''content'');
var flash = document.createElement(''OBJECT'');
flash.type = "application/x-shockwave-flash";
flash.data = myFlash;
flash.width = w; // here put correct
flash.height = h; // width and height
// params of your swf :
flash.innerHTML = ''<param name=movie value="''+myFlash+''">'';
// empty the div ''content'' of popup
while(cible.firstChild) cible.removeChild(cible.firstChild);
// display the flash animation
cible.appendChild(flash);
}
</script>

<a href="bidule.swf" onclick="loadFlash(this,128,128);">bidule</a>
<a href="foo.swf" onclick="loadFlash(this,360,240);">foo</a>

Not tested ...

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date


这篇关于在新模板/ aready defined / window中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 00:23