Delayed rendering request
Hello
I would like to suggest a change in the delayed function, in order for it to be available on non-javascript browsers and search engine. Right now, the image url is not directly in the page so diagrams are inaccessible for both cases.
What I propose is to replace the div tag by a link one. The href attribute points to the image, and the content of the a tag can be the alternative text, like on the following example:
Code:
<a class="pChart" href="draw.php?Seed=2" >my image legend</a>
The script would replace it by a div with the loading image at initialization (data attribute are prefixed with pchart not to hurt other library)
Code:
<div data-pchart-url="draw.php?Seed=2" data-pchart-alt="my image legend" ><!-- generated html --></div>
And it would finally load it when actually required
Code:
<div class="pChart"><img src="draw.php?Seed=2" alt="my image legend" /></div>
It would even be easy for a user to template that, for example to add a span containing the legend under the image. If the user wants to add properties to that like classes/ids, he can add a div wrapper around the original a, that will be preserved by pChart.
However that means that no html is accepted in the a tag, that could be a problem solved by saying that the alternative text is stored in a data attribute (data-pchart-alt) and that the content is just deleted.
In case you don‘t want that, would it be possible to at least replace the use of formatted id attribute by using a normal id and a data attribute? In my opinion it would more respect the semantics.
[you can delete my comment on the documentation website, I just discovered this forum that is a better place for that]
Mathieu