Use defer="defer" rather than onload to try and speed up page loading.
This commit is contained in:
parent
789c6343d9
commit
a473b4ebd9
2 changed files with 7 additions and 6 deletions
|
@ -44,7 +44,7 @@
|
|||
for editing OpenStreetMap.
|
||||
</div>
|
||||
<%= javascript_include_tag 'swfobject.js' %>
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript" defer="defer">
|
||||
var brokenContentSize = $("content").offsetWidth == 0;
|
||||
var fo = new SWFObject("/potlatch/potlatch.swf?d="+Math.round(Math.random()*1000), "potlatch", "100%", "100%", "6", "#FFFFFF");
|
||||
// 700,600 for fixed size, 100%,100% for resizable
|
||||
|
@ -105,7 +105,7 @@
|
|||
}
|
||||
|
||||
window.onresize = handleResize;
|
||||
window.onload = handleResize;
|
||||
|
||||
|
||||
handleResize();
|
||||
</script>
|
||||
<% end %>
|
||||
|
|
|
@ -77,13 +77,13 @@ by the OpenStreetMap project and it's contributors.
|
|||
<%= javascript_include_tag 'map.js' %>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript" defer="defer">
|
||||
<!--
|
||||
var brokenContentSize = $("content").offsetWidth == 0;
|
||||
var marker;
|
||||
var map;
|
||||
|
||||
function init(){
|
||||
function mapInit(){
|
||||
map = createMap("map");
|
||||
|
||||
<% if bbox %>
|
||||
|
@ -179,6 +179,7 @@ by the OpenStreetMap project and it's contributors.
|
|||
}
|
||||
|
||||
window.onresize = handleResize;
|
||||
window.onload = init;
|
||||
|
||||
mapInit();
|
||||
// -->
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue