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 5 of 5
  1. #1
    Nol
    Nol is offline
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    x,y, to text file

    I am attempting to write a script which will allow a person to interactively chose x,y coordinates on screen and write them to a text file. I can identify the coordinates in the map server and write to a popup window now. However, I want to write a list of the to a text file - possible?. This is what I have at this time.


    function displayIdentifyPage() {

    // identifyX and identifyY are global vars storing the identify click-point
    IdentifyWindow = window.open(appDir + "IdentifyResults.htm?MAPX="
    + truncate(mapX,5) + "&MAPY=" + truncate(mapY,5) + "&MOUSEX="
    + identifyX + "&MOUSEY=" + identifyY, "IdentifyResultsWindow", "width="
    + identWinWth + ",height=" + identWinHt
    + ",scrollbars=yes,resizable=yes,toolbar=yes");
    IdentifyWindow.focus();
    }

    // handles identify mapTool event
    function identify(idX, idY) {

    // sets global vars mapX, mapY (absolute map coords) with clickpoint
    getMapXY(idX, idY);

    var common = generateCommonArgs();
    var theArgs = "request=featureinfo&x=" + idX + "&y=" + idY + "&" + common
    sendRequest(theArgs, REQUEST_TYPE_FEATURE_INFO);
    }

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Javascript can not directly access the filesystem. You need to send the data to your server and have a server-side script write to a file.

  • #3
    New Coder
    Join Date
    Nov 2004
    Location
    wisconsin
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it is possible but not directly.
    Code:
    SCRIPT>
     var name = prompt('Please enter your name:','name');
     var age = prompt('Please enter your age:','18');
     var loc = prompt('Please enter your location:','State');
    if (name == "" || age == "" || loc == ""){
    document.write("Please <a href='dynamic.html'>reload</a> and fill in all of the forms!")
    }
    else{
    document.write("<a href=\"javascript:dp=\'<table><tr><td colspan=2><font size=6>Dynamic Page</font></td></tr><tr><td><b>Your name:</b></td><td>"+name+"</td></tr><tr><td><b>Your age:</b></td><td>"+age+"</td></tr><tr><td><b>Your location:</b></td><td>"+loc+"</td></tr></table>\';\">Click here for next dynamicly generated page.</a>")
    }
    
    </SCRIPT>
    test it and you will see what i mean. please give some credit to me
    Can you commentate bowling?

  • #4
    Nol
    Nol is offline
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    Thanks for the help/ideas.

  • #5
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by jettlarue2003
    test it and you will see what i mean. please give some credit to me
    This doesn't write to a text file.


  •  

    Posting Permissions

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