Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--- proxy.cfm --->
- <cfsetting showdebugoutput="false" />
- <cfparam name="url.link" default="" />
- <cfhttp url="#url.link#" result="r" />
- <cfoutput>#serializeJSON(r)#</cfoutput>
- <!--- test.cfm --->
- <html>
- <head>
- <title></title>
- <script src="jquery-1.4.2.min.js"></script>
- <script>
- var fbLink = "http://www.facebook.com/plugins/like.php?href=<?php echo "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>%2F&layout=standard&show_faces=false&width=500&action=like&font=lucida+grande&colorscheme=light";
- $(document).ready(function(){
- $.ajax({
- url: 'proxy.cfm?link=' + fbLink,
- dataType: 'html',
- success: function(data){
- var d = JSON.parse(data);
- console.log(d);
- console.log(d.Statuscode.indexOf('200'));
- if(d.Statuscode.indexOf('200') != -1){
- console.log(d.Filecontent);
- $('#myDiv').html(d.Filecontent);
- }
- else{
- alert('error!');
- }
- }
- });
- });
- </script>
- </head>
- <body>
- <p>hi</p>
- <div id="myDiv" width="400" height="400"></div>
- <p>done</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement