0

I have a <div id="tguide"> that I use as a place holder. I was told iframes are inferior to jquery load. So this is what I have:

`$(window).on('load resize',function(e){

var transferguidelocation = "../"
    var title = $(document).attr('title');
    if(title == 'System Manuals') {
        var transferguidelocation = "../SystemManuals/"
    };
document.getElementById("tguide").innerHTML='<object type="text/html" data="' + transferguidelocation + 'shared/TransferGuide.html" style="width:100%;height:100%;"></object>'; 

As you can first it checks to see which page it's on, then it adds an extra folder location to the TransferGuide.html location.

The file loads into the <div> no problem, it looks exactly the way I want it to and data is correct, the problem is that I'm getting the below error in the browser inspector:

enter image description here

It's a bit annoying and I'm not a fan of the errors. Does anyone know how I can get rid of this?

Chester
  • 111
  • 1
  • 8
  • Possible duplicate of [Why does jQuery or a DOM method such as getElementById not find the element?](https://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element) – ASpirin Sep 16 '17 at 19:39
  • I figured it out. I was referencing my custom.js file before the js.min file, so it didn't recognize it. I just reversed the two and the error went away. – Chester Oct 08 '17 at 02:55

1 Answers1

0

I figured it out. I was referencing my custom.js file before the js.min file, so it didn't recognize it. I just reversed the two and the error went away

Chester
  • 111
  • 1
  • 8