JavaScript - Looking For 'special' Copy Paste Solution
Hi guys (and ladies)
I am a bit stuck and hope this community might shine a light, or even better can supply me with a solution. I want to do the following: - Having an ordinary webpage containing links - I will link the links with files (word processing files , MS Word, Open Office writer, wordpad or similar) - Now when clicked on the link I want the 'system' to copy the contents of the linked file to the windows clipboard, so when clicking paste, the text from the file is pasted wherever I want. To make clear, I don't want any word processing app to open, just click the link and paste where it needs to be. Possible?? MOST LIKELY but I have no clue how. Any chance someone might know the answer??? I am looking forward to the replies! Thanks PvL Similar Tutorialsdo anyone know how do make a form that automatic tab when we paste something into the box and sort it out automatically. Like cd-key box. when we copy n paste cd-key into the box it automatic inert everything into correct places. Thanks Hi, I am wondering, is there any method that can copy a file(.pdf) from server and paste it in the local drive while the file(.pdf) in the local drive is reading by users ? P/S : In Windows, the users are not allow to edit or replace the file if it's being read. Requirements : The users must read the file in local drive after copy from the server. 2 methods been tried : 1. I tried the method which make the javascript to close the browser(IE) first, then copy and replace the file but after the browser is close, everything stopped. 2. Then, I also tried to reopen the file from server first, then only I copy the file from server and replace the local file again but the problem exists again. Even though the local file is closed and file from server is open, the system just doesn't allow me to copy and replace the local file. Why ? Can anyone give me some suggestion or advice please ? Really need help on this issue. I am trying to use the cut and paste OnMouseover Slideshow that is featured at the JavascriptKit.com. I'm getting a line error code which reads "Line:81 Error: Expected ';' I have tried everything I can think of to eliminate this error...seems I know just enough to be dangerous, not enough to debug. Can someone please help me? Or at least tell me if there's someplace specific in between the script tags or elsewhere that I need to look? Killing me in Kentucky, Pam For some reason after I modified the events.js script for my events, the events.js is not being read. I have reloaded the page, cleared the cache, and reinstalled the .js file. What is wrong? In a <textarea ..., the user can do this: 1) copy some text from somewhere; 2) right-mouse click on the textarea, from the floating menu, select the Paste, the text is pasted in the textarea. How can I detect the action of the Paste menuitem being clicked (on IE and Firefox, respectively)? Thanks Scott http://www.javascriptkit.com/script/...megamenu.shtml this drop down menu works great however, if you hit control F5 in firefox, sometimes (alot) will display incorrectly). i have included two images in here just to show what i'm talking about. if you know how to fix this. please let me know. thank you and really appreciate it. Is there a way to have the websites open in new windows? I've tried the standard ways, but script doesn't work when I change it. Does anyone know what and where in the script I can add for opening in new windows. Thank you The script is shown on this page: http://www.javascriptkit.com/script/cut181.shtml Hello, I have a question about the cut and paste javascript events calendar at http://www.javascriptkit.com/script/...calendar.shtml Is there any way to add links to the event description that appears in the box below the calendar? Thanks for your help. Hello everyone! I'm using Cut & Paste Plus Size image viewer ( http://www.javascriptkit.com/script/...geviewer.shtml ) , but I noticed some problem. When the large image is loaded initially, it's not always positioned on the center of the page. After that the script works just fine, until the browser is re-started. There is link to my page: http://www.accentironwork.com/yard%20decorations.html Script code is the http://www.accentironwork.com/plusimageviewer.js http://www.accentironwork.com/plusimageviewer.css I hope some body can help me. Thanks in advance! Yeah, it's that internal search engine script again. But before you click away, I'd like to ask whether anyone can solve a problem I've come up against... I have minimally changed the script to present results with a clickable url (this is my attempt at creating an image search engine, hence having to use this method). The problem I have suddenly encountered however is that the urls, while they read complete, they only link one directory deep into my website. For example: Reads as: http://www.mysite.com/search/set1/doctor.jpg Link is: http://www.mysite.com/search As you will see, I've omitted using the numbering array and have rearranged the order in which the values for how the search results are called. Code: if (include_num == 1) { document.write(a + 1, '. <a href="', os[0], '">', os[1], '</a><br>', os[2], '<p>'); } else { document.write('<a href="', os[0], '">', os[1], '</a><br>', os[2], '<p>'); } It is with this second point that I fear I have caused the damage. Code: // ---------- script properties ---------- var include_num = 0; var bold = 1; // ---------- sites ---------- var s = new Array(); s[0] = "^this will be added soon/form.html^Click to view image^"; s[0] = "^this will be added soon/doc.txt^Click to view image^"; s[0] = "^http://mysite.net/archive/Gliding/folderthumb.jpg^Click to view image^"; s[0] = "^this will be added soon/doctor.txt^^"; // ---------- end of script properties and sites ---------- var cookies = document.cookie; var p = cookies.indexOf("d="); if (p != -1) { var st = p + 2; var en = cookies.indexOf(";", st); if (en == -1) { en = cookies.length; } var d = cookies.substring(st, en); d = unescape(d); } var od = d; var m = 0; if (d.charAt(0) == '"' && d.charAt(d.length - 1) == '"') { m = 1; } var r = new Array(); var co = 0; if (m == 0) { var woin = new Array(); var w = d.split(" "); for (var a = 0; a < w.length; a++) { woin[a] = 0; if (w[a].charAt(0) == '-') { woin[a] = 1; } } for (var a = 0; a < w.length; a++) { w[a] = w[a].replace(/^\-|^\+/gi, ""); } a = 0; for (var c = 0; c < s.length; c++) { pa = 0; nh = 0; for (var i = 0; i < woin.length; i++) { if (woin[i] == 0) { nh++; var pat = new RegExp(w[i], "i"); var rn = s[c].search(pat); if (rn >= 0) { pa++; } else { pa = 0; } } if (woin[i] == 1) { var pat = new RegExp(w[i], "i"); var rn = s[c].search(pat); if (rn >= 0) { pa = 0; } } } if (pa == nh) { r[a] = s[c]; a++; } } co = a; } if (m == 1) { d = d.replace(/"/gi, ""); var a = 0; var pat = new RegExp(d, "i"); for (var c = 0; c < s.length; c++) { var rn = s[c].search(pat); if (rn >= 0) { r[a] = s[c]; a++; } } co = a; } function return_query() { document.jse_Form.d.value = od; } function num_jse() { document.write(co); } function out_jse() { if (co == 0) { document.write('Your search did not match any images currently on file.<p>Make sure all keywords are spelt correctly.<br>Alternatively, view the Unknown Section of the Archive and help us put a name and date to your memories.'); return; } for (var a = 0; a < r.length; a++) { var os = r[a].split("^"); if (bold == 1 && m == 1) { var br = "<b>" + d + "</b>"; os[2] = os[2].replace(pat, br); } if (include_num == 1) { document.write(a + 1, '. <a href="', os[0], '">', os[1], '</a><br>', os[2], '<p>'); } else { document.write('<a href="', os[0], '">', os[1], '</a><br>', os[2], '<p>'); } } } Because of the nature of the site (it will have over 600 images eventually), my level of understanding and the obviously limitations with this script, I'm looking for a solution that doesn't require a different edit for each entry. So far I have been able to simply drop a block of urls into this script (having planted a .php script to get the image directory listing) and then 'replace all' text that needs to be edited. In short, how do I ensure that the hyperlink for the url that is returned in the search query is full and not truncated to the first directory? ANY help in the matter would be really appreciated. Thank you in advance, Sam Hello, I created a simple WYSIWYG for creating CSS based webpages. It works exactly as assumed in Safari and Chrome. However, in firefox, when you copy/paste more than one line of text, instead of formatting it as html, in puts in line breaks causing the array storing all of the data to break into multiple lines and causing an unterminated string literal. Can anyone, 1. suggest why it is behaving this way? 2. suggest a work around to allow it to work on FF? Hi everyone, I've been trying to amend this so that when I paste text in with a mouse it changes to uppercase automatically. Does anyone know how this can be done? Code: <html> <head> <script type="text/javascript"> function upperCase(x) { var y=document.getElementById(x).value; document.getElementById(x).value=y.toUpperCase(); } </script> </head> <body> Enter your name: <input type="text" id="fname" onchange="upperCase(this.id)" /> </body> </html> Thanks hi, i need to be able to allow a user to past into an editable div (via whatever the user chooses: right-click and paste, shortcut key, etc), but i want to discard formatting and only take the plain text. i can't use a textarea since the div will allow basic formatting (bold and italic) if applied by user-initiated events. the onbeforepaste event looked promising, but according to quirksmode the support is so limited as to be unusable. i searched the board, so apologies if this has been asked and answered. tyia for any suggestions. Hi all, I am having problems with a script 'Cut & Paste CSS Horizontal List Menu' from http://www.javascriptkit.com/script/...stopmenu.shtml It works on my site with Firefox but not IE 8. My site url is http://www.bridgepoint-llp.co.uk/ I would be grateful for any help anyone could supply I wish for my users to retype their email address instead of the copy and paste method to ensure they have typed it correctly both times. How could this be done, would it be Javascript ? Hello, I'm hoping someone can help me with a problem. I have downloaded and installed the Cut & Paste BackBox Image Viewer: http://www.javascriptkit.com/script/...ox/index.shtml When I click the image to activate the script, the pop-up displays at the very bottom left of the page. It's also not formatted correctly. For instance, I'm unable to see the Auto and Close buttons, the caption information is at the top and things are just generally out of whack. Everything seems to be in the correct directories. I've tried cutting and pasting the script into a plain document and the same thing happens. I'm working on this locally, so I don't have a live example. Can someone please help. I've been working at this for two days and just about wanna scream. lol Thank you in advance for your response. Hi... I did the Cut & Paste CSS Vertical List Menu, but I have an issue with submenus... Appear behind other divs. I attach a print screen. I include inside a div. Any idea? Code: <div id="sidebar1"> <ul id="verticalmenu" class="glossymenu"> <li><a href="http://www.javascriptkit.com/">JavaScript Kit</a></li> <li><a href="http://www.javascriptkit.com/cutpastejava.shtml" >Free JavaScripts</a></li> <li><a href="http://www.javascriptkit.com/">JavaScript Tutorials</a></li> <li><a href="#">References</a> <ul> <li><a href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a></li> <li><a href="http://www.javascriptkit.com/domref/">DOM Reference</a></li> <li><a href="http://www.javascriptkit.com/dhtmltutors/cssreference.shtml">CSS Reference</a></li> </ul> </li> <li><a href="http://www.javascriptkit.com/cutpastejava.shtml" >DHTML/ CSS Tutorials</a></li> <li><a href="http://www.javascriptkit.com/howto/">web Design Tutorials</a></li> <li><a href="#" >Helpful Resources</a> <ul> <li><a href="http://www.dynamicdrive.com">Dynamic HTML</a></li> <li><a href="http://www.codingforums.com">Coding Forums</a></li> <li><a href="http://www.cssdrive.com">CSS Drive</a></li> <li><a href="http://www.dynamicdrive.com/style/">CSS Library</a></li> <li><a href="http://tools.dynamicdrive.com/imageoptimizer/">Image Optimizer</a></li> <li><a href="http://tools.dynamicdrive.com/favicon/">Favicon Generator</a></li> </ul> </li> </ul> </div> Hello, I want add an onclick link from an iFrame to a form field on the parent. After to ba placed on the form field, clicking on the link a new page will be open on the iframe. I am trying this: Quote: <form name=formName> <iframe name=frameName src="<a href=http://www.google.com onclick="parent.document.forms['formName'].elements['fieldName'].value = 'do you right';" return false;">Click Here To Get Done Right</a> " width="800" height="400" ></iframe><br><br> <input type="text" id="fieldname" size="95" name="t2"> </form> letchev I am incorporating this menu into a site and for desktop users I need the mouseover. However, after referencing the link below for mobile devices (most management has Blackberrys). I am concerned the mouseover will not work on their phones. How do I add an option that will work on phones - like mouseover OR click option? http://www.quirksmode.org/m/table.html Thanks! |