function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RAJNagRAJNag 

Display With in the page

Hi All,
My requirement is whenever click on the button the pagesource code display with in the page but it's navigate ti another page how can i display code in same page , plz help me

<apex:page sidebar="false">
 
   <html>
    <head>
    </head>
    
    <body>
    
    <div style="border:1px solid pink;padding:20px;font-size:20px">
        <input type="text" name="v"><br></br>
        <input type="button" value="Click Here" onclick="msg()"/>
        </input>  
    </div>
    
   <script type="text/javascript">  
    function msg(){  
    //var url= prompt("Enter the URL :","");  
    var sValue = document.getElementsByName("v")[0].value;
    //document.write(sValue);
    //alert("I am "+sValue);
   // window.open(sValue);
    location.href = sValue;
    open(sValue);
    //window.location.assign(sValue);
      parent.location= document.getElementsByName("sValue")[0].sValue;
    //window.document(sValue);
    
    //window.location="sValue";
 
     }  
    </script>  
    <body onload="javascript: msg()"></body>
    <div style="border:1px solid pink;padding:20px;font-size:20px">
        <p><a href="sValue">Visit our HTML tutorial</a></p>
        u can try here u need to get the Page view source code
    
    </div>
    </body>
    </html>
    <html>
    <head>
    <title>SOAP JavaScript Client Test</title>
    <script type="text/javascript">
        function soap() {
            var xmlhttp = new XMLHttpRequest();
            xmlhttp.open('POST', 'http://www.webservicex.com/globalweather.asmx?wsdlm', true);

            // build SOAP request
            var sr =
                '<?xml version="1.0" encoding="utf-8"?>' +
                '<soapenv:Envelope ' +
                    'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
                    'xmlns:api="http://127.0.0.1/Integrics/Enswitch/API" ' +
                    'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
                    'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">' +
                    '<soapenv:Body>' +
                        '<api:some_api_call soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
                            '<username xsi:type="xsd:string">login_username</username>' +
                            '<password xsi:type="xsd:string">password</password>' +
                        '</api:some_api_call>' +
                    '</soapenv:Body>' +
                '</soapenv:Envelope>';

            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4) {
                    if (xmlhttp.status == 200) {

                        alert('done use firebug to see response');
                    }
                }
            }
            // Send the POST request
            xmlhttp.setRequestHeader('Content-Type', 'text/xml');
            xmlhttp.send(sr);
            // send request
            // ...
        }
    </script>
</head>
<body>
    <form name="Demo" action="" method="post">
        <div>
            <input type="button" value="Soap" onclick="soap();" />
            window.parent.location.href="soap()";
        </div>
    </form>
</body>
</html> 
</apex:page>


Thanks
Raj

 
William TranWilliam Tran
Can you post a screen print example?

click on the button the pagesource code display? with in the page but it's navigate ti another page? how can i display code in same page?

Thx