Hi everyone,
I have a html site and i’d like to include a number indicator to links in this site linking to views in a database.
Can anyone help me?
Hi everyone,
I have a html site and i’d like to include a number indicator to links in this site linking to views in a database.
Can anyone help me?
Subject: on second thought
Your subject did mention external html.Should I assume this site supports web script techs. like PHP, ASP etc?
If so,
you can use what I do with my external html sites. (asp)
request the view entry remotely i.e http://yournotesdatabasedomain/yourdatabase/yourview?readViewEntries&count=
to get the xml version of the view. After that it’s simple. Most web techs out there read xml.
You can even use JavaScript to read xml thesedays.
Subject: RE: on second thought
Thank you.I tried this using the attached code.
But I get the error ‘viewentries’ is null or not an object.
If I save the XML as file and link to this, it works perfect. Can you help me further?
Subject: See what w3c says
Accessing a remote xml file using javaScript might be the cause of your error. See what w3c says about ithttp://www.w3schools.com/xml/xml_data_island.asp
Another thing that you might want to try is accessing the view elements through external js file. here is how
within the database where your views are:
1)create a new page
2)on the page property specify the web content to “HTML”
3)on top of the page, create a js variable
and assign it to anything you want through a computed value
i.e var numberOfElements = ( @elements (…))
in your html page header import the jsfile like this.
You can simply call your varibles after that.
i.e
document.write(numberOfElements);
Good Luck!
Subject: RE: See what w3c says
Even if it looks great and I thought that could be the solutio, it does not work, too.
If I view the page in internet explorer it schows the variable declaration.
But if I load the page, i get variable not declared, while doing the document.write.
I’m very confused.
Subject: RE: See what w3c says
Make sure you put the computed value within the quotaion. DO —>ie. var myElements =“”;
This is specially very important if you are returning strings.
for example this is invalid:
var myElements = resultofformulainstring
The js thinks that you are assigning a varibale called "resultofformulainstring
" to “myElements” and throws exception.
you can also have a function return the value
function returnElements()
{
return “”;
}
and somewhere in your “html page”
document.write(returnElements());
Subject: RE: on second thought
Are you sure the URL is correct? Your code works fine for me using my ?ReadViewEntry URLs.
Subject: More specific
Can you be more specific about the html site. who/where/how/is it served.
Subject: RE: More specific
It is a normal HTML site written in Notepad and located on …\domino\data\domino\html..