2014-03-27 26 views
1

完整的新手在這,但我有一個警告框鏈接到一個HTML頁面,我只需要一個圖像顯示在此頁面中,只有鏈接被點擊。已經查看了餅乾和本地存儲,但我沒有得到任何地方。如何通過鏈接在另一個頁面上顯示圖像

這裏是我到目前爲止的代碼:

<!DOCTYPE html> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>City Soldiers Question 1 Page</title> 
<meta name="viewport" content="width=width, initial-scale=1.0"> 
<link href="stickerbook.css" rel="stylesheet" type="text/css" media="screen"> 
<link rel="stylesheet" href="mobile.css" media="screen and (max-width:480px)"/> 

<script> 

function correct() { 
    var sticker = window.confirm("Correct! Go to Sticker Collection page."); 
    if (sticker){ 
     window.location="GalleryCS.html"; 
    } 
} 

</script> 

</head> 

<body> 
<div id ="wrapper" > 
    <div id ="logo"> 
     <img src="mol_fulllogo.fw.png" alt= "Museum of Liverpool" width="400" height="106"> 
    </div> 
    <div id ="mobilelogo"> 
     <img src="mol_logo.png" alt= "Museum of Liverpool" width="120" height="150"> 
    </div> 
    <div id ="header"> 
     <h1> City Soldiers </h1> 
     <h2> Question 1</h2> 
     <p align="center">What is the answer?</p> 
    </div> 

    <div id ="maincontent" > 
     <div id ="buttons"> 
      <p> <button type="button" onClick="correct()"> A </button> </p> 
      <p> <button type="button"> B </button> </p> 
      <p> <button type="button"> C </button> </p> 
      <p> <button type="button"> D </button> </p> 
      <p> 
       <a href="PickaQuestionCS.html"> 
        <button type="button"> Go Back </button> 
       </a> 
      </p> 
     </div> 
    </div> 
    <div id="footer"> 
     <p>&nbsp;</p> 
     <p>&nbsp;</p> 
    </div> 

</div> 
</body> 
</html> 
+1

什麼形象?你想在哪裏展示它? – Skwal

+0

另外,什麼是鏈接。正確地做一個[tag:jsfiddle]演示。 – SaidbakR

+0

想要在此頁面上顯示基本PNG圖像: 「GalleryCS.html」 在警報框中單擊確定時加載。 – user3468911

回答

0

用在不同的頁面值中,您將最有可能使用查詢字符串餅乾,或從數據庫檢索圖像路徑, jsonxml

相關問題