Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    61
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Exclamation CSS "expression" looping

    Idk wheather to post this in CSS or javascript.

    Because this is about a advance CSS tag that exucutes javascript.

    Anyway,

    For this test I am doing I did
    #divName{ width:expression(alert(1)); }

    However, it kept on alerting 1 over and over again.

    Is there a way to make the "expression( " CSS to run a javscript function without looping itself?

  • #2
    Regular Coder
    Join Date
    Nov 2007
    Location
    Leeds, UK
    Posts
    514
    Thanks
    24
    Thanked 19 Times in 19 Posts
    Quote Originally Posted by WebmasterLULZ View Post
    Idk wheather to post this in CSS or javascript.

    Because this is about a advance CSS tag that exucutes javascript.

    Anyway,

    For this test I am doing I did
    #divName{ width:expression(alert(1)); }

    However, it kept on alerting 1 over and over again.

    Is there a way to make the "expression( " CSS to run a javscript function without looping itself?
    yea you are telling javascirpt to alert 1 so its alerting 1 try using this
    #divName{ width:expression(void(alert(1))); }

    you need to stop alert returning true or it will exspect a size for the width
    or this might work aswell:
    Code:
    #divName{ width:expression(alert(1);return '0px';); }
    Working towards a Internet where we don't have website just browser applications Kill the Hyper-link and say hello to 3D Games in the browser :)

  • #3
    Regular Coder
    Join Date
    Oct 2007
    Posts
    277
    Thanks
    2
    Thanked 4 Times in 4 Posts
    isn't expressions work only in IE, I suggest you'll use JS and then you can loop easily using for loops, and while loops.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •