Subject: Can’t execute onLoad in passthrough javascript in Client
Ah, but the page isn’t “entirely passthru HTML” – it’s a Notes Rich Text page that happens to have passthru HTML on it. Even in a web browser, what you have wouldn’t work unless you set the page to “Treat page content as HTML”. What the browser would see is an tag and a … section INSIDE the . The “Treat page content as HTML” option doesn’t work at all in Notes unless you are getting the page using an HTTP URL. If you want code in the “”, you need to use the JavaScript Header code slot, and if you want code to fire during the onload event, you need to put it in the onLoad code slot.
I got that part working by changing the outline entry formula to call table.html. Creating table.html with Web Access set to Notes. table.html now has the following passthru html:
And it has the following in the onLoad event, Web, Common JavaScript:
document.all.tablediv.innerHTML = “bob loblaw law blog”;
When I click the Internet Explorer icon, I get a page with the text (bob loblaw law blog). But if I preview in Notes, I get a Javascript error: ToObjectError: document.all has no properties. I get that same error if I click on the outline when it’s in the top frame of a frameset in the Notes client.
Why am I getting this error? I guess the Notes DOM for Javascript is different than IE (my browser is set to Notes) or something like that. In fact, if I change the browser to Notes with IE, it works just like on the web (correctly, that is). Unfortunately, the client company uses Notes browser and I need this to work for both Notes browser and Notes with IE.
Subject: RE: Notes Javascript document object model
document.all is an Internet Explorer ONLY collection. Don’t use it – ever. IE has other ways of accessing elements that other browsers (including the Notes browser) can understand, like document.getElementById().
That doesn’t matter in this case, though. If users are accessing the form in Notes, then there is no HTML
to modify since your HTML will be converted to Notes Rich Text for display. That’s what happens when you preview in Notes. You can’t modify the HTML in the client after it’s been converted to rich text.
Subject: RE: Notes Javascript document object model
So how can I create the page I need. I need to create a page which has a dynamic table – both the rows and columns will vary – and will be very large. The user needs to be able to click in the cells and edit the values, and double clicking will get a popup box with more detailed edits. Of course, instead of single and double clicking we can put in links in each cell.
Basically, I need to lookup a list of projects, for the top. Then I need to lookup a list of resources for the left side. Then I need to create a table of resources by projects with the number of hours each resource is dedicated to the project in the cell.
I was thinking of using XMLHTTP to lookup the projects, then the resources, and then generate the table. This page will be used in the Notes Client and probably within a frame. How would you do this in Notes?
Subject: RE: Notes Javascript document object model
If you need to work in HTML, you need to use a client tool that “does” HTML – either a proper browser OR an embedded browser ActiveX control. If your client won’t allow the use of a browser, something that can access real, live HTML via HTTP, then they can’t have the application they want – it’s as simple as that.
Subject: RE: Can’t execute onLoad in passthrough javascript in Client
Hiya Stan. Thanks, as always, for your help.
I can’t quite get this working right and I’m tearing my hair out with the wierd responses I’m getting.
If I understand you, I have two possible solutions: 1) set index.html’s Web access, Content type to HTML (what you call "Treat page contents as HTML), or 2) Put alert(“ini”); in index.html’s init event.
That was due to the src attribute in the frame element. Although topframe.html does exis, I removed the src element – it wasn’t supposed to be there. But I still get the rror 404, can’t find topframe.html.
Next, I changed the page back to content type Notes, I removed the passthru and put alert"init"); in the page’s onLoad. But I still get the 404 saying the topframe.html is missing even though there is no reference to it in index.html.
Finally, I tried creating a new, from scratch, index.html. I copied the original passthru HTML to it’s form and left is as passthru. I made no other changes (web content is treated as Notes). But I got the same error saying it can’t find topframe.html (not index.html).
I figured this was a cache error and tried restarting Notes, but I still get the 404 error looking for topframe.html.
I’m perplexed by these responses. Any idea what’s going on?