0

I am loading SVG images with help of object tags into my page. I determine if an image is completly loaded by an eventhandler added to the object tags

objectTag.onload = initialiseSVG;
objectTag.onerror = handleError;

But if the SVG file does not exist the error function does not get called.

What is the correct way to check if the <object> data source is not available?


I have done this by loading the old pdf file on view and then add signature on that view and then render the view. check the following post

Add a signature image to a pdf without showing the pdf data to user in iOS

But not able create the pdf which contain existing pdf with signature "without showing on view" .

4

1 回答 1

0

我在这个问题上搜索了更长的时间,最后在另一个线程中找到了解决方案: Detect <embed> tag failed to load video Evgueni 的答案就是我想要的。使用 aXMLHttpRequest可以检查 URL 是否存在,因此在实际创建对象标记以包含数据之前检查数据源是否可用。谢谢你,不幸的是,我仍然没有几个代表投票支持他。

于 2014-04-18T17:11:31.730 回答