Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-12-10 05:25:20

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

GetHtml

Can anyone explain what the GetHtml plugin actually does and why or if one should use it?
One thing I noticed (actually my boss) and I found a little distrcting that it gives links some empty attributes (target, title)  which make the document not validate

Offline

#2 2005-12-13 02:47:37

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: GetHtml

- its much faster than the old functions
- the old code stripped out very often some html-code
- it produces more xhtml-valid code (eg <img /> instead of <img>)
- it doesn't destroy JavaScript and Flash (don't know how well this is currently working)
- however it might have more bugs as it is not that well tested


Niko

Offline

#3 2005-12-14 05:36:08

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: GetHtml

one deeper question: anyone bother  explaining the difference between InnerHTML ond OuterHTML?
I´m afraid I don´t quite get the concept..

Offline

#4 2005-12-14 11:26:28

wymsy
Xinha Community Member
From: Massachusetts, USA
Registered: 2005-04-01
Posts: 44
Website

Re: GetHtml

InnerHTML returns all the html under a given node in the document, not including the tag for the node itself. OuterHTML is an IE-only property that returns the html including the tag for the node.

As to the initial observation about empty attributes, it's not that GetHtml inserts them, but rather they are inserted by the _createLink function and GetHtml fails to remove them the way the built-in getHTML does. Changing these lines in _createLink:

    a.target = param.f_target.trim();
    a.title = param.f_title.trim();

to

    if(param.f_target != '') a.target = param.f_target;
        else a.removeAttribute("target");
    if(param.f_title != '') a.title = param.f_title;
        else a.removeAttribute("title");

would be one way to fix it, but it probably would be a good idea to strip empty attributes in GetHtml anyway. I'll look at doing that, just one more regular expression....

Offline

Board footer

Powered by FluxBB