Jump to content

legacyblade

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by legacyblade

  1. Hello. I'm working on a site which I'd prefer to use SVG for some of the images. However, since not all browsers support SVG, I'm going to set a global variable to true if I detect the browser supports SVG. Using this, I can check to see if SVG is supported and show PNG/gif/jpg images in the place of the SVG in older browsers (and add a small banner at the top prompting them to upgrade to a modern browser). I can already do this using javascript. But seeing as javascript can be disabled, newer browsers that can support SVG might not be fed those images (which are much smaller files). The javascript I'm using to test SVG support is as follows document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.1") the php code I tried, seeing as how it would make sense, is the following DOMImplementation::hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.1") (both of those were used in conditional branches) Is there any way to get php to test for SVG support? Or do I need to stick with javascript? Thanks for reading!
  2. bump. I still have a problem. I'd try replacing every instance of < in the string with <, but that character ends the string. < and anything after it are considered not in the string. So I'm not quite sure how to go about fixing it. I'm getting the input from a textarea that's being submitted via ah html form. Any suggestions?
  3. Thanks! That gives me a great step in the right direction. Typing in < instead of < works. However, I'm not quite sure how to replace the <s from a textarea (they paste in the HTML) with a < Any suggestions?
  4. Hello. My employer contracted me to make a web script that replaces certain items of text in an HTML document (the name, contact e-mail, etc). It's all very well and good, and functioning. Except for one error I didn't realize until the final testing. One thing that my script is replacing is a bit of the HTML code for an e-mail optin form. The script passes no errors when HTML is given to it as a string, but it refuses to replace properly. After some experimenting, I found that the problem is this: anything after a < doesn't show up in a string. Anything else (even ',",\ or other special characters) show up just fine as a character in the string. But anything after the first instance of a < is not included in the string (and when the whole string is HTML code, that doesn't work very well). I've even tried passing \<, but that just makes the value of the string "\". Does anyone know how to get around this problem?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.