1

I am trying to use lazy loading to make my search engine faster which uses lots of iframes to display different aspects of the results. In the javascript that links the id of the element to the javascript that creates the iframe I have specified frameborder="0". I am asking this question because I want to know if there is another way to get rid of the frameborder because this does not appear to be working. Here is the JavaScript code:

<script>
//doesn't block the load event
 function createIframe(){
 var i = document.createElement("iframe");
 var a = Math.random() + "";
 var t = a * 10000000000000;
 i.src = "http://harvix.com/images2.cgi?$query";
 i.scrolling = "auto";
 i.frameborder = "0";
 i.width = "100%";
 i.height = "400px";
 document.getElementById("frame1").appendChild(i);
 };
 // Check for browser support of event handling capability
 if (window.addEventListener)
 window.addEventListener("load", createIframe, false);
 else if (window.attachEvent)
 window.attachEvent("onload", createIframe);
 else window.onload = createIframe;
</script>

This JavaScript corresponds to this element which is for the iframe placement:

print"<div id=\"frame1\"></div>";

This all runs in a CGI perl document, hence the print statement.

-Dskrenta

asked Sep 21, 2013 at 17:04

2 Answers 2

1

Just a little remark. Lots of I frame gives async requests and thus async display. In my opinion it will be better to use ajax calls and get control over the display.

answered Sep 21, 2013 at 17:28
Sign up to request clarification or add additional context in comments.

Comments

0

CSS will do it easily, try this:

<style>iframe { border: none; }</style>

or

i.style = "border: none;"
answered Sep 21, 2013 at 17:17

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.