hyperlink

Link that opens a NEW page and runs javascript

淺唱寂寞╮ 提交于 2019-12-20 07:39:59
问题 I would like to know how to open a page, and then on that page, run javascript (that is set by the link on the first page). I have tried this: <a href = "http://www.example.com/otherpage" onclick = "javascript_on_otherpage()">LINK DISPLAY NAME HERE</a> Does anyone know how to achieve this? 回答1: Warning: Do not use the following code in any remotely-production related machine. It is trivially susceptible to XSS and allows anybody to run any JS code on your website. This means that a malicious

Ruby FileUtils alias on Mac?

早过忘川 提交于 2019-12-20 07:31:19
问题 How do I use Ruby's fileutils to make an alias on Mac's filesystem? Symbolic link would work too, either one. Or would I need to use some sort of shell script to do so? 回答1: Use FileUtils::symlink: FileUtils.symlink(src, dest) To learn how to make an alias via AppleScript, see https://apple.stackexchange.com/questions/51709/can-i-create-a-desktop-shortcut-alias-to-a-folder-from-the-terminal As a side note: except for the aliases (via AppleScript), Ruby will handle this correctly on any

External Link Notification - JavaScript or JQuery

 ̄綄美尐妖づ 提交于 2019-12-20 07:07:17
问题 I am looking for a way to set it up so that when an external link is clicked it will warn people that they are leaving the site. Preferably, it would darken the screen and display a message in the middle of the screen in a box with the option to click OK or Cancel. I tried to use this code: $("a.external").click(function () { alert("You are about to proceed to an external website. The Great Western Market has no control over the content of this site. Click OK to proceed."); }); and give each

Linking php form to database

╄→гoц情女王★ 提交于 2019-12-20 06:26:59
问题 Trying to link my php form to my database but it isn't working. Can anyone find a fault? It keeps giving me a parse error on the 'INSERT INTO' part of the code. <?php $link = mysql_connect($localhost,$root,$xxxxxxx); if (!$link) { die("Could not connect"); }; print "Connected to the database server"; $db_selected = mysql_select_db($module_evaluation_results, $link); if (!$db_selected) { die("Could not use the database"); }; print "selected a DB"; $result = mysql_query (INSERT INTO module

How to modify a public field of a field of a field… As in link.next.next.next(.next*n) n times

我只是一个虾纸丫 提交于 2019-12-20 05:53:07
问题 I have an array which holds links. Each link has a public field called next which can hold another link, which can hold any more links ect. When I want to delete things I can do array[x].next = array[x].next.next; which would delete the 2nd item. But I want to be able to delete any item, so how can I get it into a form with variables? The equation would be something along these lines: If I wanna delete item n I would do array[x](.next*(n-1)) = array[x](.next*n); Which if n = 4 I want to exand

Stopping a blur event on Click of a hyperlink

孤街浪徒 提交于 2019-12-20 05:51:05
问题 I used this answer jQuery <select> simulation with input and div to create a dropdown look alike. I am trying the make the user select only the options displayed in the list and he cannot enter his own value in the field. If he enters any character in the input field, then a link is displayed with the list hidden and on click of this link, the user entered value in input field is cleared and the list is again displayed to the user and the focus returned to the field. But, what happens is on

How to replace image links with img src url in Greasemonkey

烂漫一生 提交于 2019-12-20 05:11:12
问题 From the title this may sound like a duplicate question. But what I am asking for is help writing a Greasemonkey script that takes all images containing the word "thumbnails" in the src url, replaces "thumbnails" with "images" but then putting the new url into the href (target) url. What I have so far is: for(var iImage=0;iImage<document.images.length;iImage++){ var imageUrl = document.images[iImage].src; if (imageUrl.indexOf("thumbnails") != -1) { imageUrl = imageUrl.replace("thumbnails",

Dynamically add HyperLink in GridView

徘徊边缘 提交于 2019-12-20 05:10:10
问题 I have two types of code: 1st: <Columns> <asp:TemplateField> <ItemTemplate> <asp:HyperLink runat="server" Text="Скачать объект" NavigateUrl='<%#"objects/" + Eval("Идентификатор") %>'></asp:HyperLink> </ItemTemplate> </asp:TemplateField> </Columns> works normal. But TemplateField showed everytime. 2nd TemplateField templField = new TemplateField(); HyperLink hypLink = new HyperLink(); hypLink.NavigateUrl = "<%#\"objects/\" + Eval(\"Идентификатор\") %>"; hypLink.Text = "Скачать объект";

Replace non-html links with <A> tags

耗尽温柔 提交于 2019-12-20 05:01:34
问题 I have a block of code that will take a block of text like the following: Sample text sample text http://www.google.com sample text Using the preg_replace_callback method and the following regular expression: preg_replace_callback('/http:\/\/([,\%\w.\-_\/\?\=\+\&\~\#\$]+)/', create_function( '$matches', '$url = $matches[1]; $anchorText = ( strlen($url) > 35 ? substr($url, 0, 35).\'...\' : $url); return \'<a href="http://\'. $url .\'">\'. $anchorText .\'</a>\';'), $str); Will convert the

How do you remove hyperlinks from a Microsoft Word document?

情到浓时终转凉″ 提交于 2019-12-20 04:55:45
问题 I'm writing a VB Macro to do some processing of documents for my work. The lines of text are searched and the bracketed text is put in a list(box). The problem comes when I want to remove all hyperlinks in the document and then generate new ones (not necessarily in the location of the original hyperlinks) So the problem is How do I remove the existing hyperlinks? My current issue is that every time a link gets added, the hyperlinks count goes up one, but when you delete it, the count does NOT