Click here to Skip to main content
15,891,136 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Production site performance Pin
Ekjon2-Jul-14 6:01
Ekjon2-Jul-14 6:01 
AnswerRe: Production site performance Pin
thatraja2-Jul-14 8:38
professionalthatraja2-Jul-14 8:38 
GeneralRe: Production site performance Pin
Ekjon2-Jul-14 11:37
Ekjon2-Jul-14 11:37 
QuestionMedia Queries Pin
EvScott24-Jun-14 16:37
EvScott24-Jun-14 16:37 
AnswerRe: Media Queries Pin
Wombaticus26-Jun-14 2:43
Wombaticus26-Jun-14 2:43 
GeneralRe: Media Queries Pin
EvScott26-Jun-14 11:05
EvScott26-Jun-14 11:05 
QuestionWhat animation file format do I choose? Pin
Kyla C24-Jun-14 15:19
Kyla C24-Jun-14 15:19 
QuestionHTML5 'Import' failed Pin
aks.23-Jun-14 0:49
aks.23-Jun-14 0:49 
I need to display a child html page inside the main html page using HTML Import.
I tried a sample but it seems to be failing on link.import.querySelector().
The sample code I tried is mentioned below:
Can you help me to resolve the problem.

Main.html
XML
<!DOCTYPE html>
<html>
    <head>
        <link rel="import" href="Child.html">
    </head>
    <body>
        <button id="button1" onclick="onclick">Button1</button>
        <div id="ChildContainer" />
    </body>
    <script>
     button1.onclick = function ()
    {
        alert("Before reading imported files.");
        var link = document.querySelector('link[rel="import"]');

        alert("Before importing Child.");
        var template = link.import.querySelector('Child');

        alert("Before cloning contents of Child.");
        var clone = document.importNode(Child.content, true);

        alert("Before setting the child to ChildContainer.");
        document.querySelector('#ChildContainer').appendChild(clone);

    };
    </script>

</html>


Child.html
XML
<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <div id="Child">
        <h3>Sample Text</h3>
        </div>
    </body>
</html>

aks

AnswerRe: HTML5 'Import' failed Pin
Kornfeld Eliyahu Peter23-Jun-14 2:12
professionalKornfeld Eliyahu Peter23-Jun-14 2:12 
AnswerRe: HTML5 'Import' failed Pin
aks.23-Jun-14 2:36
aks.23-Jun-14 2:36 
QuestionLoad on ocx to html page Pin
aks.22-Jun-14 23:55
aks.22-Jun-14 23:55 
AnswerRe: Load on ocx to html page Pin
Kornfeld Eliyahu Peter23-Jun-14 0:06
professionalKornfeld Eliyahu Peter23-Jun-14 0:06 
GeneralRe: Load on ocx to html page Pin
aks.23-Jun-14 0:39
aks.23-Jun-14 0:39 
GeneralRe: Load on ocx to html page Pin
Kornfeld Eliyahu Peter23-Jun-14 0:44
professionalKornfeld Eliyahu Peter23-Jun-14 0:44 
Questionaccount verification after registration Pin
Member 936602121-Jun-14 5:01
professionalMember 936602121-Jun-14 5:01 
QuestionHow to find [img] [/img] tag from a text or HTML Pin
Mrinmoy Das19-Jun-14 5:07
Mrinmoy Das19-Jun-14 5:07 
QuestionYoutube custom player like edx use Pin
John.smith18-Jun-14 0:19
John.smith18-Jun-14 0:19 
QuestionInteractive 3d modeling web appication Pin
Member 1088887616-Jun-14 19:42
Member 1088887616-Jun-14 19:42 
QuestionFacebook login Pin
Member 1088717016-Jun-14 0:52
Member 1088717016-Jun-14 0:52 
AnswerRe: Facebook login Pin
Kornfeld Eliyahu Peter16-Jun-14 1:16
professionalKornfeld Eliyahu Peter16-Jun-14 1:16 
QuestionUploaded files are excluded from the folder Pin
HumaMunir10-Jun-14 22:54
HumaMunir10-Jun-14 22:54 
AnswerRe: Uploaded files are excluded from the folder Pin
Kornfeld Eliyahu Peter11-Jun-14 1:15
professionalKornfeld Eliyahu Peter11-Jun-14 1:15 
GeneralRe: Uploaded files are excluded from the folder Pin
HumaMunir11-Jun-14 20:04
HumaMunir11-Jun-14 20:04 
GeneralRe: Uploaded files are excluded from the folder Pin
Richard MacCutchan11-Jun-14 21:51
mveRichard MacCutchan11-Jun-14 21:51 
GeneralRe: Uploaded files are excluded from the folder Pin
HumaMunir11-Jun-14 23:09
HumaMunir11-Jun-14 23:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.