Search Results

Search found 30326 results on 1214 pages for 'html encode'.

Page 14/1214 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Storing arbitrary data in HTML

    - by Rob Colburn
    What is the best way to embed data in html elements for later use? As an example, let's say we have jQuery returning some JSON from the server, and we want to dump that datat out to the user as paragraphs. However, we want to be able to attach meta-data to these elements, so we can events for these later. The way I tend to handle this, is with some ugly prefixing function handle_response(data) { var html = ''; for (var i in data) { html += '<p id="prefix_' + data[i].id + '">' + data[i].message + '</p>'; } jQuery('#log').html(html).find('p').click(function(){ alert('The ID is: ' + $(this).attr('id').substr(7)); }); } Alternatively, one can build a Form in the paragraph, and store your meta-data there. But, that often feels like overkill. This has been asked before in different ways, but I do not feel it's been answered well: http://stackoverflow.com/questions/432174/how-to-store-arbitrary-data-for-some-html-tags http://stackoverflow.com/questions/209428/non-standard-attributes-on-html-tags-good-thing-bad-thing-your-thoughts

    Read the article

  • How to make all table borders invisible in MS Word after copying from HTML

    - by TheBW
    I am in a situation where I need to make a HTML report into a word report with nothing more that Ctrl+C or opening it with Word. I end up with a lot of nested tables. Problem lies in the fact that css formats the table in HTML while in Word document they are left with horrible looking borders, that need to be invisible. It would take extensive amounts of time to make each tables borders invisible. Is there a way to make all borders of every table in document invisible?

    Read the article

  • 'How decode my encode xml data?

    - by Alex
    Hi <% 'Stage 1 datas=Server.URLencode("<PaginationData currentPage=""1"" totalPages=""9""/>") response.write "Encode = " datas &"</br></br>" 'Stage 2 response.write "Decode = " 'How i again decode my encode data? %> In the "Stage 1" , i encode my xml data In the "Stage 2", How i decode the "Stage 1" Encode data? hoping your support

    Read the article

  • Slash-started resources redirection in HTML with .htaccess

    - by Pawka
    I have moved old version of webpage to some subdirectory: http://www.smth.com/old/. But all resources (images, css, etc.) in HTML are linked with slash symbol at the start. So browser still tries to load them from root path. For example old/test.html contains: <img src="/images/lma_logo.ico" /> <!-- not working !--> <img src="images/lma_logo.ico" /> <!-- working !--> How can I rewrite ulrs to load resources from the "old" dir if urls still starts with "/"?

    Read the article

  • Technique for selectively formatting data in a PowerShell pipeline and output as HTML

    - by halr9000
    Say that you want to do some fancy formatting of some tabular output from powershell, and the destination is to be html (either for a webserver, or to be sent in an email). Let's say for example that you want certain numeric values to have a different background color. Whatever. I can think of two solid programmatic ways to accomplish this: output XML and transform with XSLT, or output HTML and decorate with CSS. XSLT is probably the harder of the two (I say that because I don't know it), but from what little I recall, it has the benefit of bring able to embed the selection criteria (xpath?) for aforementioned fancy formatting. CSS on the other hand needs a helping hand. If you wanted a certain cell to be treated specially, then you would need to distinguish it from its siblings with a class, id, or something along those lines. PowerShell doesn't really have a way to do that natively, so that would mean parsing the HTML as it leaves convertto-html and adding, for example, a "emphasis" class: <td class="emphasis">32MB</td> I don't like the idea of the required text parsing, especially given that I would rather be able to somehow emphasize what needs emphasizing in Powershell before it hits HTML. Is XSLT the best way? Have suggestions for how to markup the HTML after it leaves convertto-html or ideas of a different way?

    Read the article

  • Fancy Box to Popup an HTML Page from One List Item in an Unordered List

    - by nicorellius
    I have an unordered list: <ul> <li><a id="fancy_popup" href="popup.html" class="fancybox"> Popup HTML Link</a></li> <li><a href="other.html">Other HTML Link</a></li> <li><a href="other.html">Other HTML Link</a></li> </ul> And I have a jQuery script: <script type="text/javascript"> $(document).ready(function() { $("#fancy_popup").fancybox({ transitionIn : 'elastic', transitionOut : 'elastic', easingIn : 'easeInSine', easingOut : 'easeOutSine', speedIn : 400, speedOut : 200, titlePosition : 'inside', titleFormat : 'document.write("Fancy Box Title");', cyclic : true }); }); </script> This jQuery Fancy Box script works elsewhere, with a div that has the id="fancy_popup" so I thought why not add it to the anchor directly in this case... I'm trying to figure out how to apply Fancy Box so that when someone clicks the Popup HTML link above, a Fancy Box window pops up, according to the script. I've tried variations with placing the id on the li, on the ul and manipulating the script for these selectors to no avail. Any help is appreciated.

    Read the article

  • Batch convert of Word docs with images to HTML

    - by dylpickle
    OK, here is my situation: I made a knowledge base for a company, they have about 500 word documents with screenshots in them explaining procedures and such. I can easily paste the text into the cms wysiwyg editor on the knowledge base but the images need to be uploaded one at a time, then sized and placed in the article. Question: Is there any suggestions for an automatic method to to convert the documents to html with the appropriate image tags and links to the images in them, and export/package the images for ftp upload? I can already convert them to HTML automatically using a batch file and a program, but converting the images to the correct tags with href link, then exporting them for ftp is where i need some help. Might not even be possible, but if anyone has tried to do something like this I would like to here how you approached this.

    Read the article

  • MVC3 html.TextBox

    - by BigTommy79
    I have login view that takes a LoginPageViewModel: public class LoginPageViewModel : PageViewModel { public string ReturnUrl { get; set; } public bool PreviousLoginFailed { get; set; } public LoginFormViewModel EditForm { get; set; } } which is rendered in the view. When a user tries to log in I only want to post the LoginFormViewModel (Model.EditForm) to the controller: public ActionResult Login(LoginFormViewModel loginDetails) { //do stuff } Using Html.TextBox I can specify the name of the form field manually 'loginDetails.UserName' and post back to the controller and everything works. @model Web.Controllers.User.ViewModels.LoginPageViewModel @using (Html.BeginForm()){ @Html.Hidden("loginDetails.ReturnUrl", Model.ReturnUrl) @Html.LabelFor(x => x.EditForm.UserName, "User Name:") @Html.TextBox("loginDetails.UserName", Model.EditForm.UserName) @Html.ValidationMessageFor(x => x.EditForm.UserName) ..... But what I want to do is to use the staticaly typed helper, something like: @Html.TextBoxFor(x => x.EditForm.UserName) But I'm unable to get this to work. Are you only able to post back the same model when useing the strongly typed helpers? Is there something I'm missing on this? Intellisense doesn't seem to give any clues such as a form field string.

    Read the article

  • <%: %> brackets for HTML Encoding in ASP.NET 4.0

    - by Slauma
    Accidentally I found this post about a new feature in ASP.NET 4.0: Expressions enclosed in these new brackets <%: Content %> should be rendered as HTML encoded. I've tried this within a databound label in a FormView like so: <asp:Label ID="MyLabel" runat="server" Text='<%: Eval("MyTextProperty") %>' /> But it doesn't work: The text property contains script tags (for testing), but the output is blank. Using the traditional way works: <asp:Label ID="MyLabel" runat="server" Text='<%# HttpUtility.HtmlEncode(Eval("MyTextProperty")) %>' /> What am I doing wrong? (On a sidenote: I am too stupid to find any information: Google refuses to search for that thing. The VS2010 Online help on MSDN offers a lot of hits, but nothing related to my search. Stackoverflow search too. And I don't know how these "things" (the brackets I mean) are officially called to have a better search term.) Any info and additional links and resources are welcome! Thanks in advance!

    Read the article

  • Best practice. Do I save html tags in DB or store the html entity value?

    - by Matt
    Hi Guys, I was wondering about which way i should do the following. I am using the tiny MCE wysiwyg editor which formats the users data with the right html tags. Now, i need to save this data entered into the editor into a database table. Should I encode the html tags to their corresponding entities when inserting into the DB, then when i get the data back from the table, not have the encode it for XSS purposes but I'd still have to use eval for the html tags to format the text. OR Do i save the html tags into the database, then when i get the data back from the database encode the html tags to their entities, but then as the tags will appear to the user, I'd have to use the eval function to actually format the data as it was entered. My thoughts are with the first option, I just wondered on what you guys thought.

    Read the article

  • PHP: best practice. Do i save html tags in DB or store the html entity value?

    - by Matt
    Hi Guys, I was wondering about which way i should do the following. I am using the tiny MCE wysiwyg editor which formats the users data with the right html tags. Now, i need to save this data entered into the editor into a database table. Should i encode the html tags to their corresponding entities when inserting into the DB, then when i get the data back from the table, not have the encode it for XSS purposes but i'd still have to use eval for the html tags to format the text. OR Do i save the html tags into the database, then when i get the data back from the database encode the html tags to their entities, but then as the tags will appear to the user, i'd have to use the eval function to actually format the data as it was entered. My thoughts are with the first option, i just wondered on what you guys thought. Thanks M

    Read the article

  • How do I use the html 'title' attribute with Html.Encode()?

    - by Kai
    Hello, I've been tryin to find an example of the syntax for getting an html 'title' for a string when using Html.Encode(). I want to display the full name in the mouseover title, if it's too long. Is there a way to do this without wrapping the string in a < span , i.e. <span title = "<%=Html.Encode(model.Name) %>"> //displays the full name on mouseover <%=Html.Encode(model.Name.Substring(0, 10))%>... //displays the name up to a max length </span> Or should I just do it this way? Thanks!

    Read the article

  • .htaccess 301 redirect with regex?

    - by Eddie ZA
    How to do this with regular expression? Old -> New http://www.example.com/1.html -> http://www.example.com/dir/1.html http://www.example.com/2.html -> http://www.example.com/dir/2.html http://www.example.com/3.asp -> http://www.example.com/dir/3.html http://www.example.com/4.asp -> http://www.example.com/dir/4.html http://www.example.com/4_a.html -> http://www.example.com/dir/sub/4-a.html http://www.example.com/4_b.html -> http://www.example.com/dir/sub/4-b.html I've tried this: Redirect 301 /1.html http://www.example.com/dir/1.html Redirect 301 /2.html http://www.example.com/dir/2.html Redirect 301 /3.asp http://www.example.com/dir/3.html Redirect 301 /4.asp http://www.example.com/dir/4.html Redirect 301 /4_a.html http://www.example.com/dir/sub/4-a.html Redirect 301 /4_b.html http://www.example.com/dir/sub/4-b.html

    Read the article

  • Centring an HTML element relative to its parent when its width is greater than its parent. [closed]

    - by casr
    I mocked up my intended outcome. So the blue element is the main content of the website and the yellow element represents something like a diagram or an image that has a greater width than the blue element. Ideally, I would like a purely CSS solution that is able to deal with various sizes of images. I have tried various things but have failed so far. I hope you can help! Here’s some example markup to set you on your way. <!DOCTYPE HTML> <html> <head> <title>Example</title> <style> #el1 { display: block; margin: 0 auto; width: 30em; background-color: #8cabde } #el2 { /* works when the width is less than the parent */ display: block; margin: 0 auto; } </style> </head> <body> <article id=el1> <p>Some content above.</p> <img id=el2 src=http://i.imgur.com/JFfGG.gif title=spaceball width=600 height=400> <p>Some content below.</p> </article> </body> </html>

    Read the article

  • HUDSON: how to manually encode the LDAP managerPassword?

    - by user64204
    I need to know how to manually encode the LDAP managerPassword which controls the authentication to hudson: <securityRealm class="hudson.security.LDAPSecurityRealm"> <server>ldap.example.org</server> <rootDN>dc=example,dc=org</rootDN> <userSearchBase>ou=People</userSearchBase> <userSearch>uid={0}</userSearch> <groupSearchBase>ou=Groups</groupSearchBase> <managerDN>cn=admin,dc=example,dc=org</managerDN> <managerPassword>{HOW DO I ENCODE THIS?}</managerPassword> </securityRealm> This question has already been raised here: http://jenkins.361315.n4.nabble.com/How-to-encode-the-LDAP-managerPassword-td2295570.html The answer was to configure the managerPassword field via the hudson web interface. The problem we have is that in order to configure LDAP one must be authenticated to hudson, which we cannot do because our LDAP authentication is currently broken (password mismatch between LDAP and the hudson configuration). Can someone explain how to manually encode the LDAP managerPassword? Thanks

    Read the article

  • Why is Html.DropDownList() producing <select name="original_name.name"> instead of just <select name

    - by DanM
    I have an editor template whose job is to take a SelectList as its model and build a select element in html using the Html.DropDownList() helper extension. I'm trying to assign the name attribute for the select based on a ModelMetadata property. (Reason: on post-back, I need to bind to an object that has a different property name for this item than the ViewModel used to populate the form.) The problem I'm running into is that DropDownList() is appending the name I'm providing instead of replacing it, so I end up with names like categories.category instead of category. Here is some code for you to look at... SelectList.ascx <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.Web.Mvc.SelectList>" %> <%= Html.DropDownList( (string)ViewData.ModelMetadata.AdditionalValues["PropertyName"], Model) %> Resulting HTML <select id="SkillLevels_SkillLevel" name="SkillLevels.SkillLevel"> <option value="1">High</option> <option value="2">Med</option> <option selected="selected" value="3">Low</option> </select> Expected HTML <select id="SkillLevels_SkillLevel" name="SkillLevel"> <option value="1">High</option> <option value="2">Med</option> <option selected="selected" value="3">Low</option> </select> Also tried <%= Html.Encode((string)ViewData.ModelMetadata.AdditionalValues["PropertyName"])%> ...which resulted in "SkillLevel" (not "SkillLevels.SkillLevel"), proving that the data stored in metadata is correct. and <%= Html.DropDownList( (string)ViewData.ModelMetadata.AdditionalValues["PropertyName"], Model, new { name = (string)ViewData.ModelMetadata.AdditionalValues["PropertyName"] }) %> ...which still resulted in <select name=SkillLevels.Skilllevel>. Questions What's going on here? Why does it append the name instead of just using it? Can you suggest a good workaround? Update: I ended up writing a helper extension that literally does a find/replace on the html text: public static MvcHtmlString BindableDropDownListForModel(this HtmlHelper helper) { var propertyName = (string)helper.ViewData.ModelMetadata.AdditionalValues["PropertyName"]; var compositeName = helper.ViewData.ModelMetadata.PropertyName + "." + propertyName; var rawHtml = helper.DropDownList(propertyName, (SelectList)helper.ViewData.Model); var bindableHtml = rawHtml.ToString().Replace(compositeName, propertyName); return MvcHtmlString.Create(bindableHtml); }

    Read the article

  • Mark text in HTML

    - by Alon
    Hi I have some plain text and html. I need to create a PHP method that will return the same html, but with <span class="marked"> before any instances of the text and </span> after it. Note, that it should support tags in the html (for example if the text is blabla so it should mark when it's bla<b>bla</b> or <a href="http://abc.com">bla</a>bla. It should be incase sensitive and support long text (with multilines etc) either. For example, if I call this function with the text "my name is josh" and the following html: <html> <head> <title>My Name Is Josh!!!</title> </head> <body> <h1>my name is <b>josh</b></h1> <div> <a href="http://www.names.com">my name</a> is josh </div> <u>my</u> <i>name</i> <b>is</b> <span style="font-family: Tahoma;">Josh</span>. </body> </html> ... it should return: <html> <head> <title><span class="marked">My Name Is Josh</span>!!!</title> </head> <body> <h1><span class="marked">my name is <b>josh</b></span></h1> <div> <span class="marked"><a href="http://www.names.com">my name</a> is josh</span> </div> <span class="marked"><u>my</u> <i>name</i> <b>is</b> <span style="font-family: Tahoma;">Josh</span></span>. </body> </html> Thanks.

    Read the article

  • Learning HTML - The Process.

    - by Gabe
    So, as recommended, I did the W3Schools HTML and XML tutorials this weekend. I understand the basics. Now should I look to get more depth in HTML, or go straight into learning CSS (and try to keep learning html at the same time)? If the first, where should I go for more advanced HTML tutorials?

    Read the article

  • Load html document in javascript from text

    - by QAH
    Hello everyone! Is it possible to load an html document into a DOM javascript object so that you can read the elements in the document? For example, if I have a file on the server Test.html. Can the page Hello.html call javascript code to load Test.html into a DOM object? Please let me know. Thanks

    Read the article

  • Pure Java HTML viewer / renderer

    - by dma_k
    I wonder what are the available pure embeddable Java HTML viewers? The requirements are: Should implement JComponent interface to be placed into Scrollable pane. Should be preferably a free solution; opensource is a plus. Availability as maven artifact is a plus. I know only few components: Build-in Java JEditorPane, supports HTML 3.2 Cobra Toolkit, open source, supports HTML 4, Javascript and CSS 2 MARTHA by RealObjects, commercial, supports HTML 4, CSS 2.1 Any other components?

    Read the article

  • PHP SAX parser for HTML?

    - by Daniel
    Hi. I need HTML SAX (not DOM!) parser for PHP able to process even invalid HTML code. The reason i need it is to filter user entered HTML (remove all attributes and tags except allowed ones) and truncate HTML content to specified length. Any ideas?

    Read the article

  • outputting html in runtime in asp.net

    - by madness800
    Hi all, I'm building a website at the moment, I've some html fragment that is being stored into the database, I've been reading around that inserting HTML at runtime poses security risks by using the InnerHTML property of any html tag with runat server on it. So, my question is there any alternative way to safely display the html code and won't pose security risks and is it best to assume any textboxes on any given page is dangerous and process the text in the textboxes with Server.HtmlEncode before I store it to database? Cheers

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >