WordPress.org

Support

Support » Plugins and Hacks » Hacks » using DOM in plugins

using DOM in plugins

  • I have trouble understanding how some things are related.

    For a plugin, I would like to use HTML DOM on content from wp_remote_open to find a string.

    In order to use DOM, does it have to be enabled by my webhost? or do I include a DOM parsing script with the plugin?

    I was thinking that if it needs to be enabled by the webhosting company, I would rather use a regular expression to find the string because then it would be compatible for everyone’s installation.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do you mean “Document Object Model“? That isn’t really something that is installed or enabled, so no, you don’t need anything special on the server.

    The document object model is a part of the browser. You don’t need to worry about it.

    If you want to use methods to traverse the DOM tree you need to look at methods in PHP or Javascript.

    As a rule of thumb never use regular expressions to replace DOM traversing. It’s very slow in comparison.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘using DOM in plugins’ is closed to new replies.
Skip to toolbar