# Solved: Runtime error: Object required. How to fix? -please! :-)



## nervous novice (Feb 25, 2009)

OK, I'm not really nervous. Registration just required a longer name than anything else that came to me at the moment. I *am* a novice at coding.

I use FP 2003 (I know, I know). Until recently I've mostly stayed in the 'design' mode; rare exceptions have included inserting videos and a few small tweaks. Tonight I wanted to graduate to adding the little script doohickey that says "this page last updated."

The first page I did went fine. The second, not so fine.

I'm getting the following error message:
A runtime error has occurred. Do you wish to debug?
Line: 52 Error: Object required

Now, when I switch back to coding mode, the cursor doesn't position itself at line 52, but at line 14. So does that mean "line 52" means something other than line 52 of code?

Just for ha-has, here's lines 50-54:
what is natural gas?</a>[/B][/TD]
[/TR]
[TR]
[TD]
*

Line 14, where the cursor seems to want to live, reads:

w

Oddly, the script I inserted is nowhere near the top of the page with this other gibberish; it's way down beginning at line 2446! - and appears to be working fine.

Even more oddly, when I tried to overwrite the error on my local file by publishing from the remote file to the local file, it didn't fix the problem.

Any words of wisdom on how and what to fix, oh gurus?

And, what are the consequences of not fixing it - would it interfere with my site visitors' experience at the site?

Many, many thanks,
nn (otherwise known as LS, but that was way too short)*


----------



## amanxman (Mar 28, 2006)

> And, what are the consequences of not fixing it - would it interfere with my site visitors' experience at the site?


Yes if they are getting the error message every time they go to the page!

Did the page work BEFORE you added your script?
Remove the script from the html and try it again. Does it return to working?

If the line the error is referring to isn't obvioiusly the html line, it is likely to be the line in the script you're implementing.

Are you able to post a URL of the working page, and the broken page?

Cheers


----------



## JimmySeal (Sep 25, 2007)

_Object required_ is a JavaScript error and there is no JavaScript in either of those snippets you pasted. The line numbers in the errors tend to be a bit unhelpful but in this case it may mean line 14 _of the script_.
But as it stands, it's nearly impossible to troubleshoot this issue without seeing the actual code in operation.


----------



## nervous novice (Feb 25, 2009)

Thanks for the replies.
To amanxman:
Last night I didn't think all visitors to the page were getting an error message - at least, I wasn't; that was one of the first things I checked. My question was in part, would that be browser-dependent? I use Firefox; for me the remote page was behaving fine in FF last night, there was no error message, and the script is working. I was too tired when I wrote, and didn't think to test the page in IE and Netscape...duh. OK, now I'm getting a runtime error as a visitor when switching from viewing the page in IE back to FF.

The error message appears in FrontPage when I'm, e.g. switching between code and design modes - and then it's a pain, because the decode? question just doesn't want to take no for an answer, and if I say yes I haven't a clue what to do once the Visual Basics editor is launched.

Don't know if this is relevant but the result of the script viewed in Netscape is a little different: instead of just yielding the "last updated" message with date, Netscape shows a little more info - what looks like an incomplete clock time: This page was last updated: Wed, 25 Feb 2009 06:5

As far as I know, the page was fine until I inserted the script, which makes sense given JimmySeal's reply.

The URL is http://www.un-naturalgas.org/hydraulic_fracturing_a-z.htm

I don't have a backup of the page before the script so can't send a URL for that - and as I said, what was really odd is that before I finally gave up and uploaded the page w/ script to the web, I tried to get my pre-bug version locally back; that is, I tried to overwrite my local changes by downloading the presumably un-changed page from the remote website, but it didn't fix my problem.

I'll reply separately to the other posts.


----------



## nervous novice (Feb 25, 2009)

JimmySeal, thanks. Here's the script, plus a few lines above and below.
[/TR]
[/TABLE]


----------



## nervous novice (Feb 25, 2009)

Folks, without more help I couldn't fix the problem.

I did have a backup copy from pre-tinkering, at another computer/different location. Got there today, grabbed the good file and have used it to restore my local file and the page at the website, so going to the URL now won't be of any diagnostic value.

So, problem isn't solved, in that I still don't know what I did wrong, but at least I can work on the page in FrontPage and visitors can view the page at the website without getting the runtime error.

I would still be grateful to know the fix for the script. I'm trying to study the code for the page where the script went in uneventfully and compare it to the code on the one that wound up with the error to see if I can figure out what's different.


----------



## tomdkat (May 6, 2006)

If you could make a test copy of the page with the JavaScript in place, we can look into it further.

Peace...


----------



## nervous novice (Feb 25, 2009)

OK. Bear with me, please: what do you mean by test copy - the page in code? and where do I put it so that you can view it? You wouldn't want the entire page, all 2500 lines of it, posted into one of these reply screens.


----------



## tomdkat (May 6, 2006)

What I mean is this:

Make a copy of this page:

http://www.un-naturalgas.org/hydraulic_fracturing_a-z.htm

that has the JavaScript you tried to use in it. Call it "testpage.htm". Upload that to your server in the SAME PLACE that hydraulic_fracturing_a-z.htm is located. Then, post a link to it here and then we can look at the JavaScript issue in greater detail.

This way, your main site isn't affected AND we can have access to the HTML for context to diagnose the JavaScript problem. 

Peace...


----------



## nervous novice (Feb 25, 2009)

Thank you; will do. Bear with me...


----------



## nervous novice (Feb 25, 2009)

I'm starting to wonder if this had anything to do with trying to insert the "last updated" script. It would be so odd if it was a coincidence, but:

Turns out, even with having transferred the clean local copy that had been stored on my backup machine to the machine I do most of the work on, and then uploading that 'clean' file to replace the corrupted one on the website, I *am* getting the runtime error in Frontpage, and also after switching from viewing the page on the website in my usual Firefox to view it in IE, and then switching back to FF.

The only other script on the page is the Sitemeter script, which I've never had a moment's trouble with before.

The upshot is that you can in fact go to the URL I sent in an earlier post and get the problem - no need for me to create a test page.

Thanks for any and all insights.


----------



## tomdkat (May 6, 2006)

I do NOT get any error messages in the Error Console in Firefox 3.0.6 on Linux when I view this page:

http://www.un-naturalgas.org/hydraulic_fracturing_a-z.htm

Peace...


----------



## nervous novice (Feb 25, 2009)

Thanks so much for checking the page. You're not getting an error, but I am...What could account for that?

I've just compared my sitemeter script from a page that's working with the problem page. Every character matches.


----------



## tomdkat (May 6, 2006)

Well, I'm loading the page over the Internet while you're probably loading it from your local computer. For security reasons, the browser component of FrontPage might be blocking JavaScript execution or hindering it.

What happens when you load the page over the Internet as I do?

Peace...


----------



## nervous novice (Feb 25, 2009)

I'm doing both: My tests of the page include loading it from the internet. That's what I mean about viewing it in Firefox and IE: it seems that one sure way to make the runtime error appear is to use Firefox's handy "view this page in IE" switch and then use it to switch back to Firefox.


----------



## nervous novice (Feb 25, 2009)

Sorry - to finish answering your question, as long as I use and stay in Firefox, nothing happens - no runtime error.


----------



## tomdkat (May 6, 2006)

Then the problem might be IE-centric.

If you could post the test page with the JavaScript code you added, I can see if I get an error in Firefox on my end.

Peace...


----------



## nervous novice (Feb 25, 2009)

OK, will see if I can find and load that page per your instructions.


----------



## nervous novice (Feb 25, 2009)

Done:
http://un-naturalgas.org/testpage.htm


----------



## nervous novice (Feb 25, 2009)

New script (this page updated last) is almost at the bottom of the page.

Again, thank you.


----------



## tomdkat (May 6, 2006)

Well, your script worked fine for me. I got no error messages of any kind. 

Attached is a screenshot of the bottom of the page.

Peace...


----------



## nervous novice (Feb 25, 2009)

Well, all I can say is I'm completely flummoxed.

Yes, the "last updated" script itself always worked fine, from the moment I inserted it. 

It was the runtime errors messages that were givin' me fits.

And get this - I'm not getting them now. After my last post I once again repeated the various sequences of actions that brought them on so many times before, and didn't get them, with either the pre-script or post-script pages. Ooooh-wee-oooh... 

In any case, thank you very much for all the time you've put into this.


----------



## JimmySeal (Sep 25, 2007)

I am able to reproduce this issue by opening the page in IE and then closing the IE Window. This appears to be a known issue with the flash player that occurs with certain types of .swf files and unfortunately it doesn't look like there's much you can do aside from removing that Flash from your page:

http://bugs.adobe.com/jira/browse/FP-529

A potential workaround would be putting _id_ attributes on the and tags in your page. Not sure if it'll work, but worth a try.


----------



## nervous novice (Feb 25, 2009)

Thank you! Can you, without too much trouble, tell me what Flash on my page is causing the interference with IE? I don't know how to detect this.


----------



## nervous novice (Feb 25, 2009)

I don't have the skills to build homemade Flash doohickeys into my pages - I'm guessing it's somewhere where I've inserted a video.

Hadn't given it any thought until now, but each of those instances where I copied code to insert a video are scripts, aren't they?


----------



## nervous novice (Feb 25, 2009)

Certain things are making sense now: If it's an Adobe Flash issue, that explains why my 'clean copy' overwrites made no difference - the new "last updated" script coincidence was a red herring.

The first page I inserted that new code into has no links to videos, therefore gets no error messages.

And Line 52 has no relation to the numbered lines on my page.

What doesn't make sense is why this problem just started. It was days and many page editing sessions ago that I built in the last video added to date.

The Adobe bugs page also doesn't explain (at least not as far as I can tell) why I was getting the runtime error in FrontPage - when I hadn't gone anywhere near IE in at least a month.


----------



## tomdkat (May 6, 2006)

JimmySeal said:


> I am able to reproduce this issue by opening the page in IE and then closing the IE Window. This appears to be a known issue with the flash player that occurs with certain types of .swf files and unfortunately it doesn't look like there's much you can do aside from removing that Flash from your page:
> 
> http://bugs.adobe.com/jira/browse/FP-529
> 
> A potential workaround would be putting _id_ attributes on the and tags in your page. Not sure if it'll work, but worth a try.


Great detective work! 

Peace...


----------



## nervous novice (Feb 25, 2009)

tomdkat said:


> Well, your script worked fine for me. I got no error messages of any kind.
> 
> Attached is a screenshot of the bottom of the page.
> 
> Peace...


I just wanted to address this: so what you were saying is that the fact that the "last updated" script was working as intended, that should have told me that it wasn't the source of the error message I was getting? Conversely, if a script is generating an error message, I should be able to figure out which one it is by which one isn't functioning as intended?

Per the 'novice' part of my moniker, for all I knew, the script could work and still generate an error message.


----------



## tomdkat (May 6, 2006)

nervous novice said:


> I just wanted to address this: so what you were saying is that the fact that the "last updated" script was working as intended, that should have told me that it wasn't the source of the error message I was getting?
> 
> 
> > Yep, since the script you identified displayed a message, if that script had a problem the message either wouldn't appear at all or wouldn't appear correctly.
> ...


----------



## nervous novice (Feb 25, 2009)

OK, thank you!


----------



## nervous novice (Feb 25, 2009)

A potential workaround would be putting _id_ attributes on the and tags in your page. Not sure if it'll work, but worth a try.[/quote]

Sorry, you've already put a bunch of time into my issue, but can you elaborate a bit?

Not being familiar with coding, I don't know how, where, or what, starting with what an id (I assume that's as in ID) attribute does exactly, and what the appropriate attribute(s) name would be in this case. Do these tags go before and after every video? If you could give me a little more to go on, I would research.

Thanks a million. You've been a tremendous help.


----------



## nervous novice (Feb 25, 2009)

I'm going to mark this thread as solved, but that's not to say I wouldn't appreciate more info...

Thanks, all.


----------

