Solved

use html tag with javascript?

Posted on 2014-03-06
5
319 Views
Last Modified: 2014-03-07
i am using an iframe

i do not have html tags right now

just javascript

if i add html - want to add a title and favicon,

will this slow down the page?
speed is essential - 250mb file being loaded

where should i order html tags -before and end before javascript
or include javascript inside it?
0
Comment
Question by:finnstone
  • 3
5 Comments
 
LVL 55

Expert Comment

by:Julian Hansen
ID: 39911710
if i add html - want to add a title and favicon,
Do you want to add these inside the iframe? If so - you can't - security model prevents parent from modifying iframe child.
0
 

Author Comment

by:finnstone
ID: 39911723
No outside
0
 
LVL 55

Expert Comment

by:Julian Hansen
ID: 39911755
So what is the relevance of the iframe?
0
 
LVL 1

Assisted Solution

by:weaverk
weaverk earned 250 total points
ID: 39911911
In comparison to 250mb file, a title and favicon will not make a significant change to the speed...

personally i put my Js after the html

<!DOCTYPE html>
<html>
<body>
<h1>Title</h1>
...
... other html
...

<script>
... js here
</script>
</body>
</html>

Open in new window

0
 
LVL 55

Accepted Solution

by:
Julian Hansen earned 250 total points
ID: 39911980
The position does not matter.

Consider this code
<!doctype html>
<html>
<head>
</head>
<body>
<iframe src="http://www.marcorpsa.com/ee/slowpage.php"></iframe>
<script type="text/javascript">
	document.title = 'BOTTOM SCRIPT';
</script>
</body>
</html>

Open in new window

The slowpage.php file just delays 15 seconds before sending output - but as you will see from the code (http://www.marcorpsa.com/ee/t591.html) the title is set immediately.

This link (http://www.marcorpsa.com/ee/t591a.html) is the same script but with the JS at the beginning (<head>).

In both cases the title is set before the iframe loads
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS issue in Nested Master Pages 9 26
Save ms data to server side. 19 55
return false must be hit after calling certain command 10 32
HTML Anchor Link Problem 3 35
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question