Results 1 to 3 of 3

Thread: Need help making a code generator and divs

  1. #1
    Join Date
    Mar 2009
    Posts
    8
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Need help making a code generator and divs

    Here's a list of questions.. any help would be extremely appreciated!

    1. Can anyone help me make a code generator? Or give me a link to a site which can explain how to make one?
    2. Is there a way to make a div appear onclick? Would it be possible to capture the x and y positions of the mouse then make the div appear on that position? Or is there a simpler way?
    3. How do I make a popup "preview" that shows the code generated in a new window but on the same page?

    I know it's alot to ask but if you could help in ANY way, I would greatly appreciate it!

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    1. Can anyone help me make a code generator? Or give me a link to a site which can explain how to make one?
    Easy. Take the code and use document.write(codeValue) to write it onto the webpage. Better yet, this code could be submitted in a form via PHP. It could then be echoed on the webpage via PHP and it won't involve any JavaScript. If you would like a different kind of code generator, let us know which language (it probably can't be PHP or any compiled language...). If I've mistaken you, let me know. You may be wanting a generator that makes code on its own, and not be a 'code parser' or 'code generator' (which is how I say it) which takes programming code and, in a way, makes a program on its own.

    2. Is there a way to make a div appear onclick? Would it be possible to capture the x and y positions of the mouse then make the div appear on that position? Or is there a simpler way?
    Yes. Look it up on Google. "finding x y coordinates using javascript". I'm lazy, so I don't feel like coding anything right now. Let me know if you would like me to code it for you. Then I would.

    3. How do I make a popup "preview" that shows the code generated in a new window but on the same page?
    You could do this via a <div>, but if this is some sort of 'code parser' (as mentioned in answer 1), it is best accomplished in an <iframe> considering the fact that many browsers today classify a window.open()'ed window is a 'popup'. You wouldn't want to use a <div> when using a 'parser' because it could interfere with other code on the page.

    Any other questions? I know that question 1 may have thrown me off...

  3. The Following User Says Thank You to magicyte For This Useful Post:

    xilovemusic123x (03-04-2009)

  4. #3
    Join Date
    Mar 2009
    Posts
    8
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by magicyte View Post
    Easy. Take the code and use document.write(codeValue) to write it onto the webpage. Better yet, this code could be submitted in a form via PHP. It could then be echoed on the webpage via PHP and it won't involve any JavaScript. If you would like a different kind of code generator, let us know which language (it probably can't be PHP or any compiled language...). If I've mistaken you, let me know. You may be wanting a generator that makes code on its own, and not be a 'code parser' or 'code generator' (which is how I say it) which takes programming code and, in a way, makes a program on its own.



    Yes. Look it up on Google. "finding x y coordinates using javascript". I'm lazy, so I don't feel like coding anything right now. Let me know if you would like me to code it for you. Then I would.



    You could do this via a <div>, but if this is some sort of 'code parser' (as mentioned in answer 1), it is best accomplished in an <iframe> considering the fact that many browsers today classify a window.open()'ed window is a 'popup'. You wouldn't want to use a <div> when using a 'parser' because it could interfere with other code on the page.

    Any other questions? I know that question 1 may have thrown me off...
    Much thanks Chris! I'll be sure to ask if needed in the future.

Bookmarks

Posting Permissions

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