locked
Button Backgroud-Image toStaticHtml Problem RRS feed

  • Question

  • Hi guy's having a problem getting the background image of a button to be set using an inline css style. I have no idea why it is not working. Here is the code.

    function setSrc() { document.getElementById("theText").innerHTML = document.getElementById("theText").innerHTML + window.toStaticHTML ("<button id='buttonBox' style='width:185px; height:274px; margin-left:15px; margin-right:15px; margin-top:0px; margin-bottom:0px; background-image:url(C:\Users\Anton\ice.jpg) no-repeat; background-position:center;'></button>"); var urll = document.getElementById("theText").innerHTML; var msgBox = new Windows.UI.Popups.MessageDialog(urll,"MessageBox"); msgBox.showAsync(); }

    Note I have put a messagebox in to see exactly what is being outputted and it appears that background-image is being ripped out completely! have no idea why, mebay you guys can shed some light on it, I have read about the toStaticHtml function and it says that background-image is allowed.


    • Edited by Anton2k Wednesday, July 25, 2012 6:17 PM
    Wednesday, July 25, 2012 6:10 PM

All replies