Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 79/584 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • How do you access the DOM node in jquery inside of a javascript variable?

    - by KallDrexx
    I have the following html <div id="list_item_template"><li><a href="#">Text</a></li></div> and javascript: var item = $("#list_item_template").clone(); What I want to do is access the inner <a> tag of the cloned copy and add an attribute. Without cloning I would just do: $("#list_item_template a").attr("onclick", "SomeFunction()"); However, I need to perform that operation on the cloned copy, not on the html currently on the page. How would I do this?

    Read the article

  • How to use unicode inside an xpath string? (UnicodeEncodeError)

    - by Gj
    I'm using xpath in Selenium RC via the Python api. I need to click an a element who's text is "Submit »" Here's the error that I'm getting: In [18]: sel.click(u"xpath=//a[text()='Submit \xbb')]") ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (1121, 0)) --------------------------------------------------------------------------- Exception Traceback (most recent call last) /Users/me/<ipython console> in <module>() /Users/me/selenium.pyc in click(self, locator) 282 'locator' is an element locator 283 """ --> 284 self.do_command("click", [locator,]) 285 286 /Users/me/selenium.pyc in do_command(self, verb, args) 213 #print "Selenium Result: " + repr(data) + "\n\n" 214 if (not data.startswith('OK')): --> 215 raise Exception, data 216 return data 217 <type 'str'>: (<type 'exceptions.UnicodeEncodeError'>, UnicodeEncodeError('ascii', u"ERROR: Invalid xpath [2]: //a[text()='Submit \xbb')]", 45, 46, 'ordinal not in range(128)'))

    Read the article

  • How can i get the absolute position of an SVG element inside the SVG tag using javascript?

    - by Morten
    Hi! I am trying to return the absolute position of an element in a SVG. I have tried using basic javascript functions to return the relative position but I only have access to the contentDocument since the SVG is embeded using an OBJECT tag. Because of this I cannot recurse thru the elements to find the position of the element position... Is there any native SVG functions to get the position of an element relative to the SVG element (X=0, Y=0)? Thank you, Morten!

    Read the article

  • How to iterate loop inside a string searching for any word aftera fixed keyword?

    - by Parth
    Suppose I have a sting as "PHP Paddy,PHP Pranav,PHP Parth", now i have a count as 3,now how should I iterate loop in the string aiming on string after "PHP " to display the all the names? Alright This is the string "BEGIN IF (NEW.name != OLD.name) THEN INSERT INTO jos_menuaudit set menuid=OLD.id, oldvalue = OLD.name, newvalue = NEW.name, field = "name"; END IF; IF (NEW.alias != OLD.alias) THEN INSERT INTO jos_menuaudit set menuid=OLD.id, oldvalue = OLD.alias, newvalue = NEW.alias, field = "alias"; END IF; END" in which i am searching the particular word after " IF (NEW.", and after that particualar others strings should not b displayed, hence whenever in a loop it finds " IF (NEW." I musr get a word just next to it. and in this way an array should b ready for to use.

    Read the article

  • [jquery/javascript] Trigger function when mouse click inside textarea AND type stop typing...

    - by marc
    Welcome, In short, my website use BBcode system, and i want allow users to preview message without posting it. I'm using JQuery library. I need 3 actions. 1) When user click in textarea i want display DIV what will contain preview, i want animate opening. 2) When user typing, i want dynamical load parsed by PHP code to DIV. (i'm still thinking what will be best option... refresh every 2 seconds, or maybe we can detect and refresh after 1 second of inactivity [stop typing]) 3) When user click outside textarea i want close preview div with animation. For example the PHP parser will have patch /api/parser.php and variable by POST called $_POST['message']. Any idea my digital friends ?

    Read the article

  • How do I concatenate a lot of files into one inside Hadoop, with no mapping or reduction

    - by Leonard
    I'm trying to combine multiple files in multiple input directories into a single file, for various odd reasons I won't go into. My initial try was to write a 'nul' mapper and reducer that just copied input to output, but that failed. My latest try is: vcm_hadoop lester jar /vcm/home/apps/hadoop/contrib/streaming/hadoop-*-streaming.jar -input /cruncher/201004/08/17/00 -output /lcuffcat9 -mapper /bin/cat -reducer NONE but I end up with multiple output files anyway. Anybody know how I can coax everything into a single output file?

    Read the article

  • How can i use a duration setting on .animate if it is inside the callback from a .fadeOut effect?

    - by Jannis
    I am trying to just fade the content of section#secondary out and once the content has been faded out, the parent (section#secondary) should animate 'shut' in a slider animation. All this is working however the durations are not and I cannot figure out why. Here is my code: HTML <section id="secondary"> <a href="#" class="slide_button">&laquo;</a> <!-- slide in/back button --> <article> <h1>photos</h1> <div class="album_nav"><a href="#">photo 1 of 6</a> | <a href="#">create an album</a></div> <div class="bar"> <p class="section_title">current image title</p> </div> <section class="image"> <div class="links"> <a class="_back album_link" href="#">« from the album: james new toy</a> <nav> <a href="#" class="_back small_button">back</a> <a href="#" class="_next small_button">next</a> </nav> </div> <img src="http://localhost/~jannis/3781_doggie_wonderland/www/preview/static/images/sample-image-enlarged.jpg" width="418" height="280" alt="" /> </section> </article> <footer> <embed src="http://localhost/~jannis/3781_doggie_wonderland/www/preview/static/flash/secondary-footer.swf" wmode="transparent" width="495" height="115" type="application/x-shockwave-flash" /> </footer> </section> <!-- close secondary --> jQuery // ============================= // = Close button (slide away) = // ============================= $('a.slide_button').click(function() { $(this).closest('section#secondary').children('*').fadeOut('slow', function() { $('section#secondary').animate({'width':'0'}, 3000); }); }); Because the content of section#secondary is variable I use the * selector. What happens is that the fadeOut uses the appropriate slow speed but as soon as the callback fires (once the content is faded out) the section#secondary animates to width: 0 within a couple of milliseconds and not the 3000 ms ( 3 sec ) I set the animation duration to. Any ideas would be appreciated. PS: I cannot post an example at this point but since this is more a matter of theory of jQuery I don't think an example is necessary here. Correct me if I am wrong..

    Read the article

  • How set panel Default Button that is inside a details view in asp.net?

    - by Avinash
    <asp:panel ID="Panel1" runat="server"> <asp:DetailsView ID="DetailsView1" .... <asp:templatefield ShowHeader="False"> <insertitemtemplate> <asp:Button ID="btnAdd" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert"></asp:Button> ... <asp:DetailsView> </asp:panel> and i write the code for setting the panels default button in details view's DataBound event Button btnAdd = new Button(); btnAdd = DetailsView1.Rows[indexNumber].FindControl("btnAdd") as Button; Panel1.DefaultButton = btnAdd.UniqueID; but I get the error : The DefaultButton of 'Panel1' must be the ID of a control of type IButtonControl.

    Read the article

  • How can I access the JavaScript global object ("window") inside an embedded browser object (the IWebBrowser2 interface)?

    - by John Factorial
    I have an HTML page which embeds an IWebBrowser2 ActiveX (i.e. the control is essentially an Internet Explorer browser). I need to write JavaScript in this HTML page which will remove any window.onresize handler from the page loaded in the IWebBrowser2 control. IWebBrowser2 exposes the DOM through IWebBrowser2::Document, but this is equivalent to window.document. Is there any way I can get access to window or window.onresize?

    Read the article

  • How do I get a bundle reference from inside of a plugin with carbon?

    - by Nik Reiman
    I'm writing a C++ plugin in Mac OS X using the Carbon framework (yeah, yeah, I know, Apple is deprecating Carbon, but at the moment I can't migrate this code to Cocoa). My plugin gets loaded by a master application, and I need to get a CFBundleRef reference to my plugin so that I can access it's resources. The problem is, when I call CFBundleGetMainBundle() during my plugin's initialization routines, that returns a reference to the host's bundle reference, not the plugin's. How can I get a reference to my plugin's bundle instead? Note: I would rather not use anything determined at compile-time, including calling CFBundleGetBundleWithIdentifier() with a hard-coded string identifier.

    Read the article

  • Is there a tag in XHTML that you can put anywhere in the body - even inside TABLE elements?

    - by Iain Fraser
    I would like to be able to place an empty tag anywhere in my document as a marker that can be addressed by jQuery. However, it is important that the XHTML still validates. To give you a bit of background as to what I'm doing: I've compared the current and previous versions of a particular document and I'm placing markers in the html where the differences are. I'm then intending to use jQuery to highlight the parent block-level elements when highlightchanges=true is in the URL's query string. At the moment I'm using <span> tags but it occurred to me that this sort of thing wouldn't validate: <table> <tr> <td>Old row</td> </tr> <span class="diff"></span><tr> <td>Just added</td> </tr> </table> So is there a tag I can use anywhere? Meta tag maybe? Thanks for your help! Iain

    Read the article

  • Is it possible to use Google Gears inside of another Firefox extension?

    - by Dmitry Nedbaylo
    Basically, i want to implement Offline/Online XUL application with ability to upload data to server. Yes, i know there is Mozilla Storage API, but it looks like it is much more easier with Gears to have local database and to upload local changes to server using WorkerPool. Without Gears, i have no ideas how to upload local changes to remote server. Any thoughts, friends? Thanks in advance for any help.

    Read the article

  • How to provide hyperlink in email pointing to a specific method inside gwt app (but not main page)

    - by subh
    My GWT app has a search result with orderid column as hyperlink. On clicking, it opens up another tab which shows the details. I want to expose this particular functionality externally say in an email http://www.myapp.com/XYZApp.html?orderid=1234 so that user can directly go to the details page after login to the App. In JSP world, it was pretty straightforward. Is it possible in GWT given that the call to show up the details page is not in the main GWT module (XYZApp.html)

    Read the article

  • Why do Firefox and Opera ignore max-width inside of display: table-cell?

    - by brad
    The following code displays correctly in Chrome or IE (the image is 200px wide). In Firefox and Opera the max-width style is ignored completely. Why does this happen and is there a good work around? Also, which way is most standards compliant? Note One possible work around for this particular situation is to set max-width to 200px. However, this is a rather contrived example. I'm looking for a strategy for a variable width container. <!doctype html> <html> <head> <style> div { display: table-cell; padding: 15px; width: 200px; } div img { max-width: 100%; } </style> </head> <body> <div> <img src="http://farm4.static.flickr.com/3352/4644534211_b9c887b979.jpg" /> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec facilisis ante, facilisis posuere ligula feugiat ut. Fusce hendrerit vehicula congue. at ligula dolor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. leo metus, aliquam eget convallis eget, molestie at massa. </p> </div> </body> </html> [Update] As stated by mVChr below, the w3.org spec states that max-width does not apply to inline elements. I've tried using div img { max-width: 100%; display: block; }, but it does not seem to correct the issue.

    Read the article

  • ASP.NET- using System.IO.File.Delete() to delete file(s) from directory inside wwwroot?

    - by Jim S
    Hello, I have a ASP.NET SOAP web service whose web method creates a PDF file, writes it to the "Download" directory of the applicaton, and returns the URL to the user. Code: //Create the map images (MapPrinter) and insert them on the PDF (PagePrinter). MemoryStream mstream = null; FileStream fs = null; try { //Create the memorystream storing the pdf created. mstream = pgPrinter.GenerateMapImage(); //Convert the memorystream to an array of bytes. byte[] byteArray = mstream.ToArray(); //return byteArray; //Save PDF file to site's Download folder with a unique name. System.Text.StringBuilder sb = new System.Text.StringBuilder(Global.PhysicalDownloadPath); sb.Append("\\"); string fileName = Guid.NewGuid().ToString() + ".pdf"; sb.Append(fileName); string filePath = sb.ToString(); fs = new FileStream(filePath, FileMode.CreateNew); fs.Write(byteArray, 0, byteArray.Length); string requestURI = this.Context.Request.Url.AbsoluteUri; string virtPath = requestURI.Remove(requestURI.IndexOf("Service.asmx")) + "Download/" + fileName; return virtPath; } catch (Exception ex) { throw new Exception("An error has occurred creating the map pdf.", ex); } finally { if (mstream != null) mstream.Close(); if (fs != null) fs.Close(); //Clean up resources if (pgPrinter != null) pgPrinter.Dispose(); } Then in the Global.asax file of the web service, I set up a Timer in the Application_Start event listener. In the Timer's ElapsedEvent listener I look for any files in the Download directory that are older than the Timer interval (for testing = 1 min., for deployment ~20 min.) and delete them. Code: //Interval to check for old files (milliseconds), also set to delete files older than now minus this interval. private static double deleteTimeInterval; private static System.Timers.Timer timer; //Physical path to Download folder. Everything in this folder will be checked for deletion. public static string PhysicalDownloadPath; void Application_Start(object sender, EventArgs e) { // Code that runs on application startup deleteTimeInterval = Convert.ToDouble(System.Configuration.ConfigurationManager.AppSettings["FileDeleteInterval"]); //Create timer with interval (milliseconds) whose elapse event will trigger the delete of old files //in the Download directory. timer = new System.Timers.Timer(deleteTimeInterval); timer.Enabled = true; timer.AutoReset = true; timer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent); PhysicalDownloadPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "Download"; } private static void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e) { //Delete the files older than the time interval in the Download folder. var folder = new System.IO.DirectoryInfo(PhysicalDownloadPath); System.IO.FileInfo[] files = folder.GetFiles(); foreach (var file in files) { if (file.CreationTime < DateTime.Now.AddMilliseconds(-deleteTimeInterval)) { string path = PhysicalDownloadPath + "\\" + file.Name; System.IO.File.Delete(path); } } } This works perfectly, with one exception. When I publish the web service application to inetpub\wwwroot (Windows 7, IIS7) it does not delete the old files in the Download directory. The app works perfect when I publish to IIS from a physical directory not in wwwroot. Obviously, it seems IIS places some sort of lock on files in the web root. I have tested impersonating an admin user to run the app and it still does not work. Any tips on how to circumvent the lock programmatically when in wwwroot? The client will probably want the app published to the root directory. Thank you very much.

    Read the article

  • How to set Source of s:BitmapFill dinamicaly? (FLASH BUILDER, CODE INSIDE)

    - by Ole Jak
    In Flash Builder (flex 4) I try to use next code to set selected by user (from file system) Image as a repeated background. It worked with mx:Image but I want to use cool repited capabiletis of s:BitmapFill. BTW: Technic I use also does not work with S:BitmapImage. Also FP does not return any errors. What Shall I do with my code to make it work? <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:net="flash.net.*" minWidth="955" minHeight="600" > <fx:Script> <![CDATA[ import mx.controls.Alert; import mx.utils.ObjectUtil; private function btn_click(evt:MouseEvent):void { var arr:Array = []; arr.push(new FileFilter("Images", ".gif;*.jpeg;*.jpg;*.png")); fileReference.browse(arr); } private function fileReference_select(evt:Event):void { fileReference.load(); } private function fileReference_complete(evt:Event):void { img.source = fileReference.data; Alert.show(ObjectUtil.toString(fileReference)); } ]]> </fx:Script> <fx:Declarations> <net:FileReference id="fileReference" select="fileReference_select(event);" complete="fileReference_complete(event);" /> </fx:Declarations> <s:Rect id="backgroundRect" left="0" right="0" top="0" bottom="0"> <s:fill> <s:BitmapFill id="img" source="@Embed('1.jpg')" fillMode="repeat" /> </s:fill> </s:Rect> <mx:Button id="btn" label="Browse and preview..." click="btn_click(event);" /> </s:Application> Any ideas?

    Read the article

  • Trigger function when mouse click inside textarea AND type stop typing...

    - by marc
    Welcome, In short, my website use BBcode system, and i want allow users to preview message without posting it. I'm using JQuery library. I need 3 actions. 1) When user click in textarea i want display DIV what will contain preview, i want animate opening. 2) When user typing, i want dynamical load parsed by PHP code to DIV. (i'm still thinking what will be best option... refresh every 2 seconds, or maybe we can detect and refresh after 1 second of inactivity [stop typing]) 3) When user click outside textarea i want close preview div with animation. For example the PHP parser will have patch /api/parser.php and variable by POST called $_POST['message']. Any idea my digital friends ?

    Read the article

  • How can I compile a Perl script inside a running Perl session?

    - by Joel
    I have a Perl script that takes user input and creates another script that will be run at a later date. I'm currently going through and writing tests for these scripts and one of the tests that I would like to perform is checking if the generated script compiles successfully (e.g. perl -c <script>.) Is there a way that I can have Perl perform a compile on the generated script without having to spawn another Perl process? I've tried searching for answers, but searches just turn up information about compiling Perl scripts into executable programs.

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >