hashtag

href=“#” Going to Top of Page - Prevent? [duplicate]

我的未来我决定 提交于 2019-12-02 17:24:53
This question already has an answer here: How to prevent a click on a '#' link from jumping to top of page? 23 answers I have a page with some jQuery functions. The HTML on the page looks like so: <a href="#" class="service">Open</a> When I click the Open button a hidden panel slides out. The jQuery itself works great however when I click the button it also takes me to the top of the page. Is this the defualt behavior and how do I prevent every href="#" from taking me to the top of the page. Note: I could add id's and tell the href to direct to that ID. I do not want to do that for various

Detect hash tags #, mention tags @, in iOS like in Twitter App

十年热恋 提交于 2019-12-02 11:34:49
I need to Detect #Tags given in description UILabel and change text color as [UIColor BlueColor]; where i am not able to change particular text colors in UILabel to Blue. Now i am Using this UILabel in custom UITableViewCell . is there any way to solve this issue to differentiate #Tags and normal text by Text Colors ? can anybody help me to solve this ? -(NSMutableAttributedString*)decorateTags:(NSString *)stringWithTags{ NSError *error = nil; //For "Vijay #Apple Dev" NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"#(\\w+)" options:0 error:&error]; //For "Vijay

Why URI-encoded ('#') anchors cause 404, and how to deal with it in JS?

谁都会走 提交于 2019-12-01 03:52:24
prettyPhoto utilizes hashtags, but if they get encoded (to %23), most browsers will bring up a 404 error. This has been discussed before : You get a 404 error because the #callback part is not part of the URL. It's a bookmark that is used by the browser, and it's never sent in the request to the server. If you encode the hash, it becomes part of the file name instead. Why would a hash become part of the file just because it's URI-encoded? Isn't it a bug? I'm asking because prettyPhoto uses hashtags and suffers from the same issue. I think adding a '?' before the hash is the most elegant

Extracting Twitter hashtag from string in PHP

 ̄綄美尐妖づ 提交于 2019-12-01 01:02:57
I need some help with twitter hashtag, I need to extract a certain hashtag as string variable in PHP. Until now I have this $hash = preg_replace ("/#(\\w+)/", "<a href=\"http://twitter.com/search?q=$1\">#$1</a>", $tweet_text); but this just transforms hashtag_string into link Use preg_match() to identify the hash and capture it to a variable, like so: $string = 'Tweet #hashtag'; preg_match("/#(\\w+)/", $string, $matches); $hash = $matches[1]; var_dump( $hash); // Outputs 'hashtag' Demo Alvaro I think this function will help you: echo get_hashtags($string); function get_hashtags($string, $str =

Why URI-encoded ('#') anchors cause 404, and how to deal with it in JS?

牧云@^-^@ 提交于 2019-12-01 00:40:25
问题 prettyPhoto utilizes hashtags, but if they get encoded (to %23), most browsers will bring up a 404 error. This has been discussed before: You get a 404 error because the #callback part is not part of the URL. It's a bookmark that is used by the browser, and it's never sent in the request to the server. If you encode the hash, it becomes part of the file name instead. Why would a hash become part of the file just because it's URI-encoded? Isn't it a bug? I'm asking because prettyPhoto uses

Extracting Twitter hashtag from string in PHP

早过忘川 提交于 2019-11-30 19:01:41
问题 I need some help with twitter hashtag, I need to extract a certain hashtag as string variable in PHP. Until now I have this $hash = preg_replace ("/#(\\w+)/", "<a href=\"http://twitter.com/search?q=$1\">#$1</a>", $tweet_text); but this just transforms hashtag_string into link 回答1: Use preg_match() to identify the hash and capture it to a variable, like so: $string = 'Tweet #hashtag'; preg_match("/#(\\w+)/", $string, $matches); $hash = $matches[1]; var_dump( $hash); // Outputs 'hashtag' Demo

Backbone router with multiple parameters

馋奶兔 提交于 2019-11-30 14:15:47
I need to get this to work: routes: { ':product' : 'showProduct', ':product/:detail': 'showProductDetail' showProductDetail never gets called while the ':product' route is set even if it is set afterwards. I tried the following routes: { ':product(/:detail)': showProductOrDetail } But this will not get called when only the second parameter changes. It is important that I have the product itself or the product and detail in the url . Does anyone know how to fix this? There's a little hacky solution to your problem. I have a feeling there is a nicer way to do this but that should work: routes: {

Extract hashtags from complex string using regex

不想你离开。 提交于 2019-11-30 09:36:13
问题 I have a crazy string, something like: sun #plants #!wood% ##arebaba#tey travel#blessed #weed das#$#F!@D!AAAA I want to extract all "words" (also containing special characters) that begin with # or that have a space right before, taking the following as a result: [ 'sun', 'plants', '!wood%', 'arebaba', 'tey', 'travel', 'blessed', 'weed', 'das', '$', 'F!@D!AAAA' ] How do I get this using regex? 回答1: You can use match using regex: [^#\s]+ : var str = 'sun #plants #!wood% ##arebaba#tey travel

AngularJS 1.1.5 - automatically adding hash tag to URLs

邮差的信 提交于 2019-11-30 04:51:23
Does anyone know why version 1.1.5 automatically adds a hashtag to your urls, and how to turn this off? IMO this is ugly looking. It happens whenever you have a url that doesn't end in a forward slash. (I'm not using routes or anything like that). So this: http://my.website.com/about becomes http://my.website.com/about#/about and this: http://my.website.com/about.html becomes: http://my.website.com/about.html#/about.html but this: http://my.website.com/about/ doesn't have this problem. I experienced this issue just the other day. I solved it by enabling HTML5 mode for $locationProvider . See

hashtags (#) in URL encoded parameters decoded on redirect

人走茶凉 提交于 2019-11-29 18:10:49
I have a two server system... one hosting the app and the other hosting the authentication/authorization. When the app detects the user isn't logged in yet, it redirects to the auth server and passes, as a parameter, the URL originally requested by the user so that after authentication, the user will be redirected back to the app server to the exact URL originally requested. However, if that original URL contains a #, the whole routine is hosed. It appears that the browsers are decoding the url encoded parameter and, as a consequence, dropping anything after the # to the floor. I've tried this