Jump to content

nogray

Members
  • Posts

    930
  • Joined

  • Last visited

Posts posted by nogray

  1. I can't really tell for sure what your function does without seeing the actual code, but this could be a problem

     

    $.facebox.close(); wrapTag("<p style=\'" + style1 +"\'>","</p>", document.forms.source.source_code); return false;

     

    (the onclick event)

     

    simply, make a function that will run all these functions and use that function in the onclick event instead.

  2. Given both pages are in the same domain, you can add a function in the parent window to replace the source of the viewing image and call it from the iframe using "parent.FUNCTIONNAME()"

     

    e.g.

    Main page
    <script type="text/javascript">
    function replace_img(src){
       document.getElementById('display').src = src;
    }
    </script>
    <iframe ....></iframe>
    <img src="images/spacer.gif" id="display" border="0" alt="" />
    
    
    Iframe page:
    <img src="images/some_image.jpg" onclick="parent.replace_img("images/some_image_large.jpg");" border="0" alt="" />
    

    Not tested

  3. Adding the a script tag will stop processing the page, so adding the confirmation in the head (you almost have it) will do the trick.

     

    Just remove the function so the confirm message shows up right away.

     

    The main issue is PHP runs before JavaScript exists, so you'll need to redirect the user to the overwrite page (not in the same page) If they want to over write the file. Here are a few option

     

    upload the file with a temporary name (ie time of upload) and if exists ask the user to overwrite or rename. The next page will take the file and change it.

     

    Give the user the option to overwrite if exists before they upload the file. If they didn't check it and it exists, return an error the file already exists.

     

    <SCRIPT LANGUAGE="JavaScript">
    var response = confirm('The file "<?=$upload?>" already exists would you like to overwrite?');
    if (response) {
        location.href = "confirm_overwrite.php?ID=SOME_ID_TO_IDENTIFY_THE_FILE";
    }
    // otherwise show the page with a new name
    </SCRIPT>
    

  4. I assume xajax sets the body cursor to an hour glass when it runs an ajax request. Search the JS code for "cursor" and you might find the solution.

     

    Just downloaded the code and they have an option to set it off

     

    in the xajax_core_uncompressed.js line 62 (line 5 in the compressed version)

     

    xajax.config.setDefault('waitCursor', false);

     

    You might've turned it to true somewhere in your script

     

    or comment the following code in the compressed version

     

    update:function(){return{onWaiting:function(){if(xajax.config.baseDocument.body)

    xajax.config.baseDocument.body.style.cursor='wait';},

     

    line 18

     

     

  5. Hi, I made a site that help webmasters convert text to png using AJAX and got a lot of request to make a standalone script. I finally got the time to release the first beta edition.

     

    If possible, could you guys go through it and let me know if you find any problems with the code. Also, any comments on improving the performance will be handy.

     

    here is the site

    http://www.text2png.com

     

    standalone solution

    http://www.text2png.com/code_standalone.php

     

     

    Thanks

    Sam

  6. <div id="my_vertical_txt"></div>
    <script type="text/javascript">
    var str = "TEXT";
    var txt = "";
    for (i=0; i<str.length; i++)
        txt += str.charAt(i)+"<br />";
    document.getElementById('my_vertical_txt').innerHTML = txt;
    </script>
    

    Not tested.

  7. In The head section add something like this

    <noscript><meta http-equiv="refresh" content="0;url=http://yourdomain.com/JS_IS_A_MUST.html"></noscript>
    

    This will redirect to JS_IS_A_MUST.html where you can explain why JS must be enabled.

     

    Be carefull with this implementation, Seach engines will NOT be able to spider your pages that contain this tag.

  8. You have a few issues with your code

     

    i.class = "buttons";

     

    To assign a class name to an object, you should use className, so your code will be

     

    i.className = "buttons";

     

     

    if (a = true)

     

    First a is an object (not a boolean) assuming it's an input field you can access it's value using the value attribute

     

    a.value

     

    for comparson use the douple == signs otherwise the statment will always be true since it's only assigning true to a

     

    Finally, all input values are strings so to compare it to a boolean will return false. Your if statment should look like this

     

    if (a.value == "true") {

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.