Search Results

Search found 7529 results on 302 pages for 'replace'.

Page 84/302 | < Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >

  • SEO/PHP: How to Convert Form-Submit URL (Get-Method) without Javascript SEO-Friendly?

    - by elmas
    hello, i have this code <form action="index.php" method="get" class="search-form"><input type="text" size="35" name="search" class="searchBox" value="" /><input type="submit" value="Start Searching!" /></form> and actually i convert the url with javascript <script type="text/javascript"> $(document).ready(function() { $('.search-form').submit(function() { var value = $('.search-form input:text').val(); value = value = value.replace(/\W/,''); // replace window.location.href = value + "-keyword" + ".html"; return false; }); }); </script> is there a method to convert the url seo-friendly without javascript? maybe with php?

    Read the article

  • Why is Java String indexOf failing?

    - by Binaryrespawn
    Hi all, this must be quite simple but I am having great difficulty. You see I am trying to find a string within another string as follows. e = input.indexOf("-->"); s = input.indexOf("<!--"); input = input.replace(input.substring(s, e + 3), " "); The integers e and s are returning -1 in that it was not found and this is causing the replace method to fail. The test string I am using is "Chartered Certified<!--lol--> Accountants (ACCA)". I tried to creat a new string object and pass in the string as an argument as follows e=input.indexOf(new String("<!--")); This yielded the same result. Any ideas ?

    Read the article

  • replacing variables in output in php

    - by Thorpe Obazee
    Right now I have this code. <?php error_reporting(E_ALL); require_once('content_config.php'); function callback($buffer) { // replace all the apples with oranges foreach ($config as $key => $value) { $buffer = str_replace($key, $value, $buffer); } return $buffer; } ob_start("callback"); ?> some content <?php ob_end_flush(); ?> in the content_config.php file: $config['SiteName'] = 'MySiteName'; $config['SiteAuthor'] = 'thatGuy'; What I want to do is that I want to replace the placeholders that with the key of the config array with its value. Right now, it doesn't work :(

    Read the article

  • Entity Framework .Include() with compile time checking?

    - by Mikey Cee
    Consider the following code, which is calling against an EF generated data context: var context = new DataContext(); var employees = context.Employees.Include("Department"); If I change the name of the entity Department then this code is going to start throwing a runtime error. So I'll have to do some kind of find and replace throughout my code to replace each occurrence of "Department". Is there any way to call the .Include() method in a safe manner, so I get compile time checking for all the entity names being referenced?

    Read the article

  • Replacing div html() by echoing PHP - how to?

    - by Jared
    Hello, I have a multiple product elements that get their class and ID from PHP: $product1["codename"] = "product-1"; $product1["short"] = "Great Product 1"; $product2["codename"] = "product-2"; $product2["short"] = "Great Product 2"; <div class="leftMenuProductButton" id="'. $product1["codename"].'" >'. $product1["short"].'</div> <div class="leftMenuProductButton" id="'. $product2["codename"].'" >'. $product2["short"].'</div> These display as: <div class="leftMenuProductButton" id="product-1" > Great Product 1</div> <div class="leftMenuProductButton" id="product-2" > Great Product 2</div> In the page, I have an element that I want to replace the HTML: <div id="productPopupTop"> //Replace this content </div> Using jquery, I have tried the following: $( '.leftMenuProductButton' ).hover ( function () { var swapNAME = $(this).attr("id"); //gets the ID, #product-1, #product-2 etc. This works. $("#productPopupTop").html(' <? echo $' + swapNAME + '["short"] ?>'); //This is supposed to get something like <? echo $product-1["short"] ?> This doesn't appear to work. }, function () { //this is just here for later }); If I try to do an alert('<? echo $' + swapNAME + '["short"] ?>'); it will literally display something like <? echo $product-1["short"] ?> Please note that both the Javascript and the PHP are externally linked in a PHP file (index.php <<< (js.js, products.php) QUESTION: How do I replace the HTML() of #productPopupTop with the ["short"] of a product? If I should use Ajax, how would I code this?

    Read the article

  • Display local image in iPhone HTML mail

    - by Sjakelien
    Hello there, In my app, I am composing an HMTL email message with the 3.0+ MFMailComposeViewController. To do this, I created an HTML file, with some placeholders. In my code, I read the HTML file, and with replaceOccurrencesOfString, I replace the placeholders with data from the app. In that way, I compose the body of the email I want to send out. This is all working very nicely, except for the fact, that in my HTML file, I have an <img src='imageplaceholderpath' /> tag. Somehow, I cannot figure out, with what I should replace this imageplaceholderpath, in order to refer to an image that resides in my app. Is this a valid approach at all, and if so, what would be the syntax/logic behind the path I should put there? I do appreciate your insights! Regards Sjakelien

    Read the article

  • What causes a UIViewController to become active?

    - by Rob Bonner
    I am sure this is an easy question, but one that has escaped me for some time now. Say I have a UIViewController, either defined as a root in an XIB or on a stack. At some point in my code I want to replace it with another view controller. Just flat out replace it. How would I do that? I have tried defining the controller and assigning, but not sure what actually makes it push on the screen with the absence of a navigation controller.

    Read the article

  • Python: Regex outputs 12_34 - I need 1234

    - by Guy F-W
    So I have input coming in like: 12_34 5_6_8_2 4___3 1234 and the output I need from it is: 1234, 5682, 43, 1234 I'm currently working with r'[0-9]+[0-9_]*'.replace('_','') which (as far as I can tell) successfully rejects any input which is not a combination of numeric digits and under-scores, where the underscore cannot be the first character. However, replacing the _ with the empty string causes 12_34 to come out as 12 and 34. Is there a better method than 'replace' for this? Or could I adapt my regex to deal with this problem?

    Read the article

  • Do word boundaries work on symbol characters?

    - by Shawn31313
    I'm trying to implement word boundaries in my emoticons feature for a chat. But for some reason I can't seem to get the word boundaries to work. I am new to regex. So when I do: var reg = /\b\Hi\b/gi; var str = 'HiHiHi Hi HiHiHi Hi'; alert(str.replace(reg, '')); This happens: Jsfiddle It actually works fine, and does remove those 2 Hi's that are standing alone. But when I change the reg to an escaped smiley and then change the string: var reg = /\b\:\)\b/gi; var str = 'HiHi:) :) HiHiHi :)'; alert(str.replace(reg, '')); This happens: Jsfiddle It just doesn't work. The string stays the same. Is it that word boundaries can't be used on symbols? If so, how does Facebook do it on their chats?

    Read the article

  • Manipulating both unicode and ASCII character set in C#

    - by Murlex
    I have this mapping in my C# application string [,] unicode2Ascii = { { "&#3001;", "\x86" } }; ஹ - is the unicode value for a tamil literal "ஹ". This is the raw hex literal for the unicode value saved by MS Word as a byte sequence. I am trying to map these unicode value "strings" to a hex value under 255 (so as to accommodate non-unicode supported systems). I trying to use string.replace like this: S = S.replace(unicode2Ascii[0,0], unicode2Ascii[0,1]); However the resultant ouput has a ? instead of the actual hex 0x86 stored. Any pointer on how I could set the encoding for the second element of that array to something like windows-1252? Or is there a better way to do this conversion? thanks in advance

    Read the article

  • Any way to find out which line break char(s) to use in Javascript?

    - by Irro
    I'm trying to parse some text into a textarea control and at the same time replace all with ordinary line break chars. I have been able to do it in windows by replacing with CR (it didn't work with CRLF strangely enough, it gave me linebreak + empty space) but I'm afraid that this code won't work in Unix/Mac because they use LF for line break. Is there any way to use the system default line break char in javascript? Something similar to Environment.NewLine in .Net (I wasn't able to write backslash in this editor but I use /r for CR and /n for LF, replace / with backslash)

    Read the article

  • Limit text area value and cut the rest

    - by streetparade
    I have a textarea which users can enter some tags. I need to limit this tags to 20 tags. Tags could be enterer this way maytag1,mytag2,mytag3 What i wrote is this function function limitTags() { var tags = $("input[type=text][name=tags]").val() var tag = $.trim(tags); var selected = new Array(); /** * replace the last ',' */ if(tag.substring(tag.length - 1) == ",") { *///tag = tag.replace(tag.length - 1, ''); } var enteredTags = tag.split(","); if( enteredTags.length > 20 ) { //$("input[type=text][name=tags]").val(enteredTags.join(",", enteredTags)); alert("Only 20 Tags allowed"); } } The alert works just fine but, after the alert box is gone. i can continiue entering tags till the alert box appears. What i need is cut the text after the messagebox which was entered also the last "," I hope i could ask my question clear. Thanks

    Read the article

  • Allow a new line anywhere in the regex?

    - by Scott Chamberlain
    I am having a find a replace in a bunch of RTF documents, The basic pattern I need is \{(?:\\\*)?\\field\\fldlock\{\\\*\\fldinst ?MERGEFIELD ?((?:\\.*?)?[\w\[\]]+?)(?:\\.*?)?\}(?:\{\\fldrslt\})?\} However I then found out there could potentialy be a newline before each slash, so it turned in to this. \{(?:\s*\\\*)?\s*\\field\s*\\fldlock\s*\{\s*\\\*\s*\\fldinst\s*MERGEFIELD\s*((?:\\.*?)?[\w\[\]]+?(?:\s*\\.*?)?)?\s*\}(?:\s*\{\s*\\fldrslt\s*\})?\s*\} But then I hit this it fails fees totaling $\protect {\field\fldlock{\*\fldinst MERGEFIELD ENTEROUTSTANDINGVETERINARYF EES}}\plain\f0\fs24\prot Is there way have to have it match a new line anywhere in the search too without adding (?:\r?\n)? everywhere? EDIT To clear up confusion on the new lines. I need to keep the newlines in the document, I only want to remove the newlines if they are inside my match, so in the final example I posted it should replace fees totaling $\protect {\field\fldlock{\*\fldinst MERGEFIELD ENTEROUTSTANDINGVETERINARYF EES}}\plain\f0\fs24\prot with fees totaling $\protect ENTEROUTSTANDINGVETERINARYFEES\plain\f0\fs24\prot

    Read the article

  • How to use various selectors in SIFR 3r436

    - by reg3n
    Hi, i'm using this sIFR.replace(neutra, { selector: '#nav li', css:[ 'a { color: #ffffff; text-decoration:none; font-size:14px} a:hover { color: #d75a60; text-decoration:underline;}'], wmode: 'transparent', preventWrap: true ,forceWidth: true ,fitExactly: true ,forceSingleLine: true ,offsetTop: 0 ,offsetLeft: 0 ,tuneWidth: 0 ,tuneHeight: 0, }); and i need to style a b inside a span inside a div ... and i just can't find the way, if i add another sIFR.replace(blah... it won't work, it messes with the other replacement sometimes :S any good reference? thanks in advance.

    Read the article

  • using regular expression / Remove special characters with linq to sql

    - by Prasad
    How can i use regular expressions with linq to sql in the asp.net mvc(C#) application? The columns in my MSSQL table (Products) has some special characters like (, - % ',.....). While searching for a product i need to search without that special chareters. For ex.: I have a product say (ABC-Camp's / One), when i search for "abccamp", it should pull the product. I am trying the query like: from p in _context.pu_Products where p.User_Id == userId && p.Is_Deleted == false && p.Product_Name.ToLower().Contains(text.ToLower()) select new Product { ProductId = p.Product_Id, ProductName = p.Product_Name.Replace("’", "").Replace("\"", ""), RetailPrice = p.Retail_Price ?? 0M, LotSize = p.Lot_Size > 0 ? p.Lot_Size ?? 1 : 1, QuantityInHand = p.Quantity_In_Hand ?? 0 } But i need to search without any special characters...

    Read the article

  • jQuery: using hover to roll-over multiple images at once.

    - by WillKop
    I have a small problem, but I'm a bit stumped. I am using the following code to do rollovers on my webpage $("#mylink1 img").hover( function() { this.src = this.src.replace("_off","_on"); }, function() { this.src = this.src.replace("_on","_off"); } ); This works great for individual images, but I would like to roll over one of them and have the the other one change as well. <a id="mylink1" href="about.cfm"><img src="images/Home_top_navs/aboutus_manage_off.gif" /></a> <a id="mylink1" href="about.cfm"><img src="images/Home_top_navs/aboutus_nav2_off.gif" /></a> Any help would be appreciated! Thank you!

    Read the article

  • Problematic tags displaying HTML in Java

    - by Andez
    Hi again, I have the following tag included in my HTML which causes the JEditorPane not to show the HTML output. <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> Not so much a big deal but anyone know why this would happen? Cannot find too much documentation on this - best I came up with was someone having a go a few years ago to see what was supported on retro virus site. At the minute I'm doing a simple find replace on the string which is not good - are there any better ways? I've seen a lot of people saying that RegEx is no good. The code I have used is this._html = this._html.replace( "<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">", ""); Andez

    Read the article

  • ExtJS (4.0) dynamic / lazy loading

    - by Paul
    Given a border layout with a west (navigation) and a center region. Let say I click on topic A in the west region, I want to replace (replace as in 'delete last topic') the center region with 'extjs' program code named topic_a.js I succeed in loading with this code: dynamicPanel = new Ext.Component({ loader: { url: '/www/file.htm', renderer: 'html', autoLoad: true, scripts: true } }); var oMainContainer = Ext.getCmp('maincontainer'); oMainContainer.show(); oMainContainer.add(dynamicPanel); But calling this the second time 'adds' things up in the center region and of course fails short in 'deleting', what would be a good approach?

    Read the article

  • ASP.NET MVC Colon in URL

    - by Joe Morgan
    I've seen that IIS has a problem with letting colons into URLs. I also saw the suggestions others offered here. With the site I'm working on, I want to be able to pass titles of movies, books, etc., into my URL, colon included, like this: mysite.com/Movie/Bob:The Return This would be consumed by my MovieController, for example, as a string and used further down the line. I realize that a colon is not ideal. Does anyone have any other suggestions? As poor as it currently is, I'm doing a find-and-replace from all colons (:) to another character, then a backwards replace when I want to consume it on the Controller end.

    Read the article

  • Mail program splits link over two lines

    - by Joran
    Hi, In C#, I'm sending a mail with an activation link to users after they have registered. However, the link is split over two lines in the mail and thus doesn't work. I've checked in Visual Studio and the string containing the link looks fine. I've also tried: strMessage.Replace("\r", ""); strMessage.Replace("\n", ""); but without success. Do you have any ideas on how to solve this? I've googled it for hours and can't find the solution... Thanks! /J

    Read the article

  • jquery issues - it wont change it accordingly

    - by chuck
    My coding isnt linking properly , its meant to use jquery to detect the OS and change the link accordingly , however it isn't. In my HTML page I have it linked in the header as <script src="jsquery.js" type="text/javascript"></script> which loads up my jsquery now $(document).ready(function() { if (navigator.appVersion.indexOf("Win") != -1) { // Computers runs windows $("a[href$='.pdf']").each(function() { this.href = this.href.replace("Volumes", "KP01DS0194TG"); }); } if (navigator.appVersion.indexOf("Mac") != -1) { // computer is a Mac $("a[href$='.pdf']").each(function() { this.href = this.href.replace("KP01DS0194TG", "Volumes"); }); } }); Yet on Mac's it still tries to connect to KP01DS0194TG and not to Volumes - it doesnt change it - how can I get it to recognize the OS and change it accordingly?

    Read the article

  • Python : How to add month to December 2012 and get January 2013?

    - by daydreamer
    >>> start_date = date(1983, 11, 23) >>> start_date.replace(month=start_date.month+1) datetime.date(1983, 12, 23) This works until the month is <=11, as soon as I do >>> start_date = date(1983, 12, 23) >>> start_date.replace(month=start_date.month+1) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: month must be in 1..12 How can I keep adding months which increments the year when new month is added to December?

    Read the article

  • Actual SQL statement after bind variables specified

    - by bioffe
    I am trying to log every SQL statement executed from my scripts. However I contemplate one problem I can not overcome. Is there a way to compute actual SQL statement after bind variables were specified. In SQLite I had to compute the statement to be executed manually, using code below: def __sql_to_str__(self, value,args): for p in args: if type(p) is IntType or p is None: value = value.replace("?", str(p) ,1) else: value = value.replace("?",'\'' + p + '\'',1) return value It seems CX_Oracle has cursor.parse() facilities. But I can't figure out how to trick CX_Oracle to compute my query before its execution.

    Read the article

< Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >