Results 1 to 4 of 4
Thread: Page on DIVs
-
09-05-2011, 08:57 AM #1
Freshman
- Join Date
- Sep 2011
- Posts
- 3
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Page on DIVs
Sorry if the topic about it was before, but "div" is too short and cant be found.
I have 3 html pages : 1. with logo, 2. menu and 3. main text
I want to put them toegether, like 1st up and 2nd and 3rd down near each other.
I read, that u can make blocks in HTML, but it was only written how to edit color inside block etc, but not how to put page inside.
Can u tell me how to do it ?
-
09-05-2011, 10:32 AM #2
- Join Date
- Apr 2008
- Location
- Boston, USA
- Posts
- 13,176
- Thanks
- 744
- Thanked 701 Times in 550 Posts
- Blog Entries
- 4
- Feedback Score
- 4 (100%)
there are many ways to do it.
Container
Using AjaxCode:<div id="myContainer"></div> <script type="text/javascript"> onload=function(){ var el=document.getElementById("myContainer") el.innerHTML="<iframe src=\"http://www.webcosmoforums.com\"></iframe>" } </script>
Using IframeCode:<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Load page by Ajax</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <style type="text/css"> </style> <script type="text/javascript"> function loadPageAjaxFunction(id, url){ var xmlHttp; try {// Firefox, Opera 8.0+, Safari xmlHttp = new XMLHttpRequest(); } catch (e) {// Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange = function(){ if (xmlHttp.readyState == 4) { //Get the response from the server and extract the section that comes in the body section of the second html page avoid inserting the header part of the second page in your first page's element var respText = xmlHttp.responseText.split('<body>'); elem.innerHTML = respText[1].split('</body>')[0]; } } var elem = document.getElementById(id); if (!elem) { alert('The element with the passed ID doesn\'t exists in your page'); return; } xmlHttp.open("GET", url, true); xmlHttp.send(null); } </script> </head> <body> <div id="test"></div> <script type="text/javascript"> loadPageAjaxFunction('test','mypageurl.htm'); </script> Using a function: <input type="button" value="Load page by Ajax call" id="ajax" onclick="loadPageAjaxFunction('test','mypageurl.htm');"/> </body> </html>
<iframe src="mypageurl.html" height="100" width="200">You need a Frames Capable browser to view this content.</iframe>
Using JQuery
Code:<!DOCTYPE html> <html> <head> <style> body{ font-size: 12px; font-family: Arial; } </style> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <div id="container"></div> <script> $("#container").load("mypageurl.html"); </script> </body> </html>Free Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK
-
09-07-2011, 08:18 AM #3
Freshman
- Join Date
- Sep 2011
- Posts
- 3
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Sry but Im not good at all in it. I tried to copy code
Using JQuery
Where and what I need to write to open my page? I tried to edit
</style> <script src="//code.jquery.com/jquery-latest.js"></script>
but nothing happened.
-
09-08-2011, 04:07 AM #4
Freshman
- Join Date
- Sep 2011
- Posts
- 3
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Maybe Im blind but I dont see EDIT option ...
So,
My main question now is which code is to put entire html object inside DIV, like u ve shown me in iframe.
Similar Threads
-
In SEO are the on page and off page optimization factors important?
By stiffen88 in forum Search Engine OptimizationReplies: 18Last Post: 04-27-2012, 07:50 AM -
Facebook fan page or business page URL customization.
By marshal in forum Social Network MarketingReplies: 7Last Post: 07-26-2011, 06:27 AM -
How start a fan page and how to link that fan page to a blog?
By alodia in forum Social Network MarketingReplies: 3Last Post: 02-12-2011, 11:15 AM -
Next Page Link Shows 404 Page Not Found on WordPress
By manik in forum BloggingReplies: 2Last Post: 09-11-2008, 09:14 AM -
Divs Side by Side
By webdigo in forum CSSReplies: 0Last Post: 05-01-2008, 01:01 PM


Reply With Quote

