Jump to content

Kowa92

Members
  • Posts

    16
  • Joined

  • Last visited

About Kowa92

  • Birthday 04/17/1992

Previous Fields

  • Languages
    Italian, English

Contact Methods

  • MSN
    campagna.lorenzo@hotmail.it
  • Skype
    Lorenzo_C92

Profile Information

  • Location
    Pordenone - Italy
  • Interests
    WebMaster & WebDesigner

Kowa92's Achievements

Newbie

Newbie (1/7)

1

Reputation

  1. Okay, thanks for your suggestion... But, how can i close a (main) window that i haven't open with the "open()" command?
  2. Hi All! I've a problem with this code that doesn't work... And i don't understend where is the mistake... This is the code: <a href="javascript:window.close();" >Close Main Window</a> Why this doesn't work? I've the Chrome Browser... But i tryed with Mozzilla Firefox too, but however doesn't want to work... Why?
  3. Pls, can you make me a little and fast example about what do you mean? This is a good solution... However, how would you do for solve it? With a little and fast example, perhaps...
  4. No, unfortunately it doesn't work...
  5. Outside of the head tags, precisely between body tags... Like this:CODE: <html><head> <style type="text/css"> body { background-color:#d0e4fe; } h1 { color:orange; text-align:center; } p { font-family:"Times New Roman"; font-size:20px; } </style> <script type="text/javascript"> function mymsg() { window.alert("Benvenuto nel Tryit Editor! =D"); } </script></head><body> <h1>Tryit Editor</h1> <p>Scrivi il codice e guarda il risultato con un click! =D</p> <form> <input type="button" value="Click Me!" onClick="mymsg();" /> </form> <script type="text/javascript"> void(); </script></body></html>
  6. Ok now it works correctly. Thank you!But the way, and if i want to target only the second script block, how should i modify the match pattern string?
  7. Ok thank you. But i have another question: If I put a source text like this: <html><head> <style type="text/css"> body { background-color:#d0e4fe; } h1 { color:orange; text-align:center; } p { font-family:"Times New Roman"; font-size:20px; } </style> <script type="text/javascript"> function mymsg() { window.alert("Benvenuto nel Tryit Editor! =D"); } </script></head><body> <h1>Tryit Editor</h1> <p>Scrivi il codice e guarda il risultato con un click! =D</p> <form> <input type="button" value="Click Me!" onClick="mymsg();" /> </form> <script type="text/javascript"> void(); </script> </body></html> and write a match pattern like this: /<script type="text\/javascript">([\w\W]*)<\/script>/ with replace patterns like these: '' how do I select only one of two matches (ie replacing only the content and its script tag content between the head tags) instead of doing as he does here? : and why the preg_replace () behaves like this? selected script tags of preg_replace() are bold. CODE: <html><head> <style type="text/css"> body { background-color:#d0e4fe; } h1 { color:orange; text-align:center; } p { font-family:"Times New Roman"; font-size:20px; } </style> <script type="text/javascript"> function mymsg() { window.alert("Benvenuto nel Tryit Editor! =D"); } </script></head><body> <h1>Tryit Editor</h1> <p>Scrivi il codice e guarda il risultato con un click! =D</p> <form> <input type="button" value="Click Me!" onClick="mymsg();" /> </form> <script type="text/javascript"> void(); </script></body></html>
  8. Thank you very much! Now it works correctly! But the way, for characters class do you mean these: "\s, \w, \W"?
  9. Doesn't work... Other solutions?
  10. Hi All! I would delete the heads tags's contents of a string from a request like this: $head = "/<head>(\s.*)*<\/head>/"; $mycode = preg_replace( $head, '', $_REQUEST['mytext']); print($mycode); The string of the request can be simplified as follows: $mytext = '<html><head> <style type="text/css"> body { background-color:#d0e4fe; } h1 { color:orange; text-align:center; } p { font-family:"Times New Roman"; font-size:20px; } </style> <script type="text/javascript"> function mymsg() { window.alert("Benvenuto nel Tryit Editor! =D"); } </script></head><body> <h1>Tryit Editor</h1> <p>Scrivi il codice e guarda il risultato con un click! =D</p> <form> <input type="button" value="Click Me!" onClick="mymsg();" /> </form> </body></html>' But my RegExp not work because the result of the function "preg_replace" returns a PHP error (null). So I tried to write other RegExp to try to clear the contents of the other basic tags: $html = "/<html>(\s.*)*<\/html>/";; $body = "/<body>(\s.*)*<\/body>/"; Inserting them in the first feature I noticed that they both work correctly. This is my problem: Why the first RegExp (head) is not working properly but the other two work? Thanks.
  11. Kowa92

    JS don't work?

    I've solved this problem without escaping/converting anything!However thanks for your help!
  12. Kowa92

    JS don't work?

    Can i use escape function (escape()) in js for encode the value from my textarea before send the form? Do you mean something like that as first of two steps?
  13. Kowa92

    JS don't work?

    Omg! And how can i fix it?
  14. Kowa92

    JS don't work?

    Any JS code. For example this: JS Code:------------------------------ <html><head><script type="text/javascript">function displayDate(){document.getElementById("demo").innerHTML=Date();}</script></head><body> <h1>My First Web Page</h1><p id="demo">This is a paragraph.</p> <button type="button" onclick="displayDate()">Display Date</button> </body></html>------------------- If we take a look at the page source of the iframe, we see that everything is correct and is exactly equal to what we write on the textarea. But if we open the tool inside the browser and inspect the iframe, it looks like this: ----------------------- <html><head><script type="text/javascript"></script></head><body> <h1>My First Web Page</h1><p id="demo">This is a paragraph.</p> <button type="button" onclick>Display Date</button> </body></html>----------------------- The onClick event and the content of script tags are empty and the script doesn't work!!!...Why?
  15. Kowa92

    JS don't work?

    I also noticed that if I open the browser's tool to inspect the inner iframe element, that the content between 2 different js script tag is empty if I type in the text window of any code in js.
×
×
  • Create New...