Search Results

Search found 8 results on 1 pages for 'zeroclipboard'.

Page 1/1 | 1 

  • zeroclipboard does not work when loaded with ajax call

    - by kylex
    I have the following code which works the way one would expect (click on the button and it copies the text in the input box): <script type="text/javascript" src="ABSOLUTE_LINK/ZeroClipboard.js"></script> <script type="text/javascript"> ZeroClipboard.setMoviePath( 'ABSOLUTE_LINK/ZeroClipboard.swf' ); </script> Copy to Clipboard: <input type="text" id="clip_text" size="40" value="Copy me!"/><br/><br/> <div id="d_clip_button">Copy To Clipboard</div> <script language="JavaScript"> echo "var clip = new ZeroClipboard.Client(); clip.setText( '' ); // will be set later on mouseDown clip.setHandCursor( true ); clip.setCSSEffects( true ); clip.addEventListener( 'load', function(client) { } ); clip.addEventListener( 'complete', function(client, text) { alert("Copied text to clipboard: " + text ); } ); clip.addEventListener( 'mouseOver', function(client) { } ); clip.addEventListener( 'mouseOut', function(client) { } ); clip.addEventListener( 'mouseDown', function(client) { // set text to copy here clip.setText( document.getElementById('clip_text').value ); } ); clip.addEventListener( 'mouseUp', function(client) { } ); clip.glue( 'd_clip_button' ); </script> However, when this code is loaded using an ajax call, the functionality disappears. Is there anything I can do to get this working when it's called via ajax?

    Read the article

  • How to actually use ZeroClipboard in jQuery?

    - by Martti Laine
    Hello I just can't get this thing. How is ZeroClipboard supposed to work? Why does it need to move the flash-element over the copied text? I've read this thing: http://code.google.com/p/zeroclipboard/wiki/Instructions Can someone provide me a short snippet, which makes it possible to copy a text in variable to users clipboard, when user clicks a link. Is this even possible? I don't care, if it doesn't work on all browsers (IE6 for example). I'm using jQuery. Martti Laine

    Read the article

  • Trouble with ZeroClipboard

    - by JorgeV44
    Hi, I'm trying to use Zeroclipboard to copy stuff to the clipboard, but it doesn't seem to be working. My code: HTML: <textarea name="texter" id="texter"></textarea> <input type="button" value="Copy to clipboard" id="copy-button" /> Javascript: <script type="text/javascript"> jQuery(document).ready(function(){ var clip = new ZeroClipboard.Client(); clip.setText(''); jQuery('#copy-button').click(function(){ clip.setText(jQuery('#texter').val()); } }); </script> What's wrong with this? Thansk!

    Read the article

  • problem on running script on different operating system

    - by Praveen kalal
    i run use a javascript code for getting browser information it run fine on microsoft windows xp but it not working on microsoft windows server 2003. my code is folowing. plz help. <html> <head> <script type="text/javascript" src="zeroclipboard/ZeroClipboard.js"></script> <script type="text/javascript"> window.onload = function F() { var today = new Date(); var the_date = new Date("December 31, 2012"); var the_cookie_date = the_date.toGMTString(); var the_cookie = screen.width +"x"+ screen.height; var the_cookie = "Screen Resolution:"+the_cookie + ";\nExpires:" + the_cookie_date+";\n Browser CodeName:"+navigator.appCodeName+";\n Browser Name: " + navigator.appName+";\n Browser Version: " + navigator.appVersion+";\n Browser Version: " + navigator.appVersion+"; \n Cookies Enabled: " + navigator.cookieEnabled +";\n Platform: " + navigator.platform+";\n User-agent header: " + navigator.userAgent; / document.getElementById('box-content').value=the_cookie; } </script> </head> <body> <textarea name="box-content" id="box-content" rows="10" cols="70"> </textarea> <br /><br /> <p><input type="button" id="copy" name="copy" value="Copy to Clipboard" /></p> </body> </html> <script type="text/javascript"> //set path ZeroClipboard.setMoviePath('http://192.168.101.135:471/browserinfo/zeroclipboard/ZeroClipboard.swf'); //create client var clip = new ZeroClipboard.Client(); //event clip.addEventListener('mousedown',function() { clip.setText(document.getElementById('box-content').value); }); clip.addEventListener('complete',function(client,text) { alert('text is copied'); }); //glue it to the button clip.glue('copy'); </script>

    Read the article

  • Copy to clipboard does not work when loaded with ajax call

    - by kylex
    I have the following code which works the way one would expect (click on the button and it copies the text in the input box): <script type="text/javascript" src="ABSOLUTE_LINK/ZeroClipboard.js"></script> <script type="text/javascript"> ZeroClipboard.setMoviePath( 'ABSOLUTE_LINK/ZeroClipboard.swf' ); </script> Copy to Clipboard: <input type="text" id="clip_text" size="40" value="Copy me!"/><br/><br/> <div id="d_clip_button">Copy To Clipboard</div> <script language="JavaScript"> echo "var clip = new ZeroClipboard.Client(); clip.setText( '' ); // will be set later on mouseDown clip.setHandCursor( true ); clip.setCSSEffects( true ); clip.addEventListener( 'load', function(client) { } ); clip.addEventListener( 'complete', function(client, text) { alert("Copied text to clipboard: " + text ); } ); clip.addEventListener( 'mouseOver', function(client) { } ); clip.addEventListener( 'mouseOut', function(client) { } ); clip.addEventListener( 'mouseDown', function(client) { // set text to copy here clip.setText( document.getElementById('clip_text').value ); } ); clip.addEventListener( 'mouseUp', function(client) { } ); clip.glue( 'd_clip_button' ); </script> However, when this code is loaded using an ajax call, the functionality disappears. Is there anything I can do to get this working when it's called via ajax?

    Read the article

  • Selecting text in mobile Safari on iPhone

    - by Goldy
    I'm trying to make it easy for an iphone user to copy some text to the clipboard in mobile safari. As in the usual "touch-hold-copy". There is a specific bit of text I want to a user to copy. I have full choice of the html markup in which to wrap the text. How can I make it easy, rather than abitrary? For instance: Is there a way to "select all" the text upon touch-down using javascript? Then a user could just continue to touch-hold and then choose copy? Is there a way to bring up the "select all" option? Like you can when typing in a text box? After which they can choose copy? If there's no javascript solution, how can I arrange the html to help Safari select the right bit of text easily? As opposed to just a word, or a wrapping div? I've tried onFocus="this.select()" for various elements, none seem to work. Also tried onClick. Those who have tried to port a site that uses ZeroClipboard to the iPhone might have some ideas. Cheers

    Read the article

  • jQuery Datatables throws error when dynamically created row headers

    - by JM4
    I am using the Datatables jquery plugin for one of my projects. For one in particular, the number of columns can vary based on how many children a consumer has (yes I realize normalization and proper technique would insert on another row but it is a client requirement). Datatables must be set up as such: <table> <thead> <tr> <th></th> </tr> </thead> <tbody> <tr> <td></td> </tr> </tbody> </table> my script starts out as: <table cellpadding="0" cellspacing="0" border="0" class="display" id="sortable"> <thead> <tr> <th>parent name</th> <th>parent phone</th> <?php try { $db->beginTransaction(); $stmt = $db->prepare("SELECT max(num_deps) FROM (SELECT count(a.id) as num_deps FROM children a INNER JOIN parents b USING(id) WHERE a.id !=0 GROUP BY a.id) x"); $stmt->execute(); $rows = $stmt->fetchAll(); for($i=1; $i<=$rows[0][0]; $i++) { echo " <th>Child Name ".$i."</th> <th>Date of Birth ".$i."</th> "; } $db->commit(); } catch (PDOException $e) { echo "<p align='center'>There was a system error. Please contact administration.<br>".$e->getMessage()."</p><br />"; } ?> </tr> </thead> In this manner, the final column headers can be 1 or 50 spots long. However, with this dynamic code in place, datatables throws the following error: ""DataTables warning (table id = 'datatable'): Cannot reinitialise DataTable. To retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrive to true. Alternativly, to destroy old table and create a new one...ETC."' Yes I have set "bRetrieve" : true in the javascript above and that does not do the trick. If I remove the code above, the file "works" fine but it leaves off the necessary columns for my table. Any ideas? Displaying JS <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script> <script type="text/javascript" src="../media/js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="../media/js/TableTools/TableTools.js"></script> <script type="text/javascript" src="../media/ZeroClipboard/ZeroClipboard.js"></script> <script type="text/javascript"> $(document).ready(function() { TableToolsInit.sSwfPath = "../media/swf/ZeroClipboard.swf"; oTable = $('#sortable').dataTable({ "bRetrieve": true, "bProcessing": true, "sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>' }); }); </script> </head> TOP piece of HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Home</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="default.css" /> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <style type="text/css" title="currentStyle"> @import "TableTools.css"; @import "demo_table_jui.css"; @import "jquery-ui-1.8.4.custom.css"; </style> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script> <script type="text/javascript" src="js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="js/TableTools/TableTools.js"></script> <script type="text/javascript" src="ZeroClipboard/ZeroClipboard.js"></script> <script type="text/javascript"> $(document).ready(function() { TableToolsInit.sSwfPath = "ZeroClipboard.swf"; oTable = $('#sortable').dataTable({ "bRetrieve": true, "bProcessing": true, "sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>' }); }); </script> </head> <body bgcolor="#e0e0e0"> <div class="main"> <div class="body"> <div class="body_resize"> <div class="liquid-round"> <div class="top"><span><h2>Details</h2></span></div> <div class="center-content"> <div style="overflow-x:hidden; min-height:400px; max-height:600px; overflow-y:auto;"> <div class="demo_jui"><br /> <table cellpadding="0" cellspacing="0" border="0" class="display" width="100%" id="sortable"> <thead> <tr> <th>First Name</th> <th>MI</th> <th>Last Name</th> <th>Street Address</th> <th>City</th> <th>State</th> <th>Zip</th> <th>DOB</th> <th>Gender</th> <th>Spouse Name</th> <th>Spouse Date of Birth</th> <!-- this part is generated with the php, when removed, datatables works just fine with the rest of the page --> <th>Dependent Child Name 1</th> <th>Dependent Date of Birth 1</th> <th>Dependent Child Name 2</th> <th>Dependent Date of Birth 2</th> <th>Dependent Child Name 3</th> <th>Dependent Date of Birth 3</th> <th>Dependent Child Name 4</th> <th>Dependent Date of Birth 4</th> <th>Dependent Child Name 5</th> <th>Dependent Date of Birth 5</th> <th>Dependent Child Name 6</th> <th>Dependent Date of Birth 6</th> <th>Dependent Child Name 7</th> <th>Dependent Date of Birth 7</th> </tr> </thead> <tbody> <tr> ... UPDATE REGARDING COMMENTS/ANSWERS I have received a number of responses indicating the number of headers may not match the field count in the body. As I mention below, eliminating the php script below altogether would eliminate 5+ fields in the header and without question throw the count match off balance. This DOES NOT however cause an error and in fact "resolves" the issue in that datatables functions properly (even though there is NO header record for 5+ fields in the body.

    Read the article

  • Use Javascript to copy Text from Label

    - by Josh
    Hello All- Label1 (asp.net control) is located inside Panel1 of my webpage and I have a button called bt. What is the Javascript to copy the Text from Label1 to the clipboard? Thanks, @ artlung, I placed the below code just outside of my form but inside the body. The last line of code I placed inside Panel1 of my form. Anything wrong with this code because nothing happens when I click the Copy to Clipboard button. <script language="JavaScript"> var clip = new ZeroClipboard.Client(); clip.addEventListener( 'mouseDown', function(client) { // set text to copy here clip.setText( document.getElementById('form1.Label1').value ); // alert("mouse down"); } ); clip.glue( 'd_clip_button' ); </script> The next line of code is above the script tags but inside Panel1 in my form <div id="d_clip_button">Copy To Clipboard</div>

    Read the article

1