Results 1 to 10 of 10

Thread: Script Tester Script

  1. #1
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Lightbulb Script Tester Script

    1) CODE TITLE: Script Tester Script

    2) AUTHOR NAME/NOTES: Nicolas Wallace (Thanks to Keyboard13333 for noting a few errors)

    3) DESCRIPTION: This is a script that you can use to test out a script that you made w/o making more HTML pages on your computer, could also be used as a website creator by giving it the power to make web pages. I have made a few scripts before, including this one. I made this kind of script at one point but it got deleted from my computer, so I rebuilt it. It is a 3kb HTML file. And it's only an HTML file.
    What code you can test with it:
    Ajax, HTML, Javascript, CSS, JQuery, and any other type of code your computer supports.
    I might eventually make a PHP code tester.
    I hope you like it, and I hope it gets added to Dynamic Drive

    4) URL TO CODE: http://daba.medianewsonline.com/scripts/sc1.html

    Edit: Sorry, the link broke.
    I attached a few html inside a zip file.
    I hope you enjoy, I lost the script twice and have rebuilt it again.
    Last edited by [Nicolas]; 02-10-2012 at 05:55 PM.
    Daba! The Fantage-like website
    Virtual World in progress.
    Out of pure HTML, Javascript, and CSS. Oh, and poorly done Paint images.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    The link you posted is broken, so I can't check it out.

    There are already a number of these around the internet, but having one on DD wouldn't hurt. The only problem is that we don't usually want these on our sites-- we want them for building our sites. But in some cases it may help.


    I might eventually make a PHP code tester.
    This is a dangerous idea. Allowing users to test code on their own computers is fine. But with a serverside language like PHP, that code will be executing on your server. At best, you'll have occasional errors with endless loops that might crash your server, and at worst you'll get hacked. In fact, either you will need to limit PHP's functions to a point where they would not be useful or you would have security holes. And only a true expert should attempt that, although honestly it wouldn't be that useful anyway, once many functions were taken out.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by djr33 View Post
    The link you posted is broken, so I can't check it out.

    There are already a number of these around the internet, but having one on DD wouldn't hurt. The only problem is that we don't usually want these on our sites-- we want them for building our sites. But in some cases it may help.


    This is a dangerous idea. Allowing users to test code on their own computers is fine. But with a serverside language like PHP, that code will be executing on your server. At best, you'll have occasional errors with endless loops that might crash your server, and at worst you'll get hacked. In fact, either you will need to limit PHP's functions to a point where they would not be useful or you would have security holes. And only a true expert should attempt that, although honestly it wouldn't be that useful anyway, once many functions were taken out.
    I know there are a few online, but there aren't as many made out of just Javascript.
    As for the PHP quote, I must pay attention. I may not do anything like that, or if I do, I will put it on a server I do not need. I could get another.
    I attached a TXT file that has the code, and I don't know why the link broke. It keeps having problems.
    Hope you enjoy.
    Daba! The Fantage-like website
    Virtual World in progress.
    Out of pure HTML, Javascript, and CSS. Oh, and poorly done Paint images.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The link you posted is broken, so I can't check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Hmm, well, it seems to work, but there are two problems:
    1. It reloads the page, causing all of the text we just entered to go away. Although in some browsers the "back" button can help us to go back and retrieve that text, that won't always work. This is very inconvenient. Many editors like this use iframes so the preview and code are independent. I think that's important.
    2. You have at least one syntax error (I didn't notice any others)-- in JS, comments are marked by //comment, not like HTML <!--comments-->. So within the JS block, you need to use JS comments, rather than the HTML comment that you have now.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by djr33 View Post
    Hmm, well, it seems to work, but there are two problems:
    1. It reloads the page, causing all of the text we just entered to go away. Although in some browsers the "back" button can help us to go back and retrieve that text, that won't always work. This is very inconvenient. Many editors like this use iframes so the preview and code are independent. I think that's important.
    2. You have at least one syntax error (I didn't notice any others)-- in JS, comments are marked by //comment, not like HTML <!--comments-->. So within the JS block, you need to use JS comments, rather than the HTML comment that you have now.
    I knew I messed that up :P
    Thank you for corrections.
    And I had it in an iFrame on the page, but for some reason Medianewsonline deleted it.
    If you want to add an iframe, I would recommend doing iframeBorder="0" scrolling="no" to an iframe.
    Code:
    <iframe src="wpt1.html" iframeBorder="0" scrolling="no" style="height: --px; width: --px;">Your browser doesn't support iFrames.</iframe>


    As for the back button and all that, I have absolutely no idea whatsoever on how to make it remember all the next inputted.
    It's a simple script as said.
    @jscheuer1 Try the TXT file and save it as an html.
    Daba! The Fantage-like website
    Virtual World in progress.
    Out of pure HTML, Javascript, and CSS. Oh, and poorly done Paint images.

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    As for the back button and all that, I have absolutely no idea whatsoever on how to make it remember all the next inputted.
    1. Using an iframe would solve this (because the text input would not disappear).
    2. Yes, it's difficult, but unfortunately without this, the script is not very helpful. Why would someone use a script that deletes their code?
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by djr33 View Post
    1. Using an iframe would solve this (because the text input would not disappear).
    2. Yes, it's difficult, but unfortunately without this, the script is not very helpful. Why would someone use a script that deletes their code?
    Ah. And it is a script tester. Mainly meant for testing scripts but you can transform it into a website creator.
    Daba! The Fantage-like website
    Virtual World in progress.
    Out of pure HTML, Javascript, and CSS. Oh, and poorly done Paint images.

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    What I'm saying is that this is more difficult to use than just saving the text in a file and opening that file in a web browser. There are more steps involved, and changing the code doesn't save your work.

    To test a file:
    1. Open/create new document in notepad.
    2. Write code.
    3. Save file.
    4. Open file in browser. = TEST

    To test using this script:
    1. Open/create new document in notepad.
    2. Write code.
    3. Select all, copy code.
    4. Go to testing script page.
    5. Paste your code.
    6. Submit. = TEST


    Without some sort of basic "saving" (at least not immediate erasing) function I just can't see how this is helpful. Do you see what I mean?

    When creating something new, it is important that the new thing is better than the old thing that it is replacing. Although it isn't significantly harder to use than just editing a text file and opening that in a browser, it is certainly not significantly easier. So I don't see how this is a step forward (or why anyone would use it).

    I'm not saying this to be mean-- in some ways, it's a limitation of the browsers. But whatever the reason, it's something you'll need to fix (eg, use an iframe) for this to be a useful script. Scripts here on DD are only useful scripts, not interesting examples of how you coded something. In fact, the way you approached this is creative (and interesting), but the end result isn't something that is productive.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. The Following User Says Thank You to djr33 For This Useful Post:

    [Nicolas] (02-10-2012)

  11. #10
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    I have editing my topic, I added a ZIP attachment to HTMLs that can do that now.
    Daba! The Fantage-like website
    Virtual World in progress.
    Out of pure HTML, Javascript, and CSS. Oh, and poorly done Paint images.

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
  •