html

Is it possible to run code if visitor is from a certain country

I want to run a bit of code if, and only if, a visitor is from a certain country, is this possible and how would i go about doing this? ...

HTML Parser fetch link text

I'm using HTML Parser to fetch links from a web page. I need to store the URL, link text and the URL to the parent page containing the link. I have managed to get the link URL as well as the parent URL. I still ned to get the link text. <a href="url">link text</a> Unfortunately I'm having a hard time figuring it out, any help would ...

Difficult Jquery <div> question, need expert advice

Hey guys, I have a bit of a weird problem. I have a jquery script that basically prepends messages from data in a php script in descending chronological order one by one so that latest messages are on the top. What I want to do is somehow put a div container around two or more these messages as they come out so I decided to check which m...

What is a "related target" for an event in ExtJS and/or DHTML?

When using ExtJS I've noticed a property "Related Target" for an event. Googling also reveals that this term is used in other DHTML related contexts, not only ExtJS. So what is this "related target" and how does it differ from the normal target (which is another property of the event object)? On this subject google revealed nothing. ...

jQuery - Get URL of iframe AFTER redirection on same domain

Using Jquery, how can I get the URL of an iframe after redirection has occurred to a URL in the same domain? ...

Print HTML in C#. Done.

I struggled for a long time how to print an HTML page in C#. Here's the Holy Grail. Taking advantage of StaTaskScheduler (taken from Parallel Extension Extras (link text)). Features: waits for the printing completion, hopefully reliable Limitations: requires C# 4.0, uses default printer, doesn't allow to change print template Tas...

php - parse html page

<div>divbox</div> <p>para1</p> <p>para2</p> <p>para3</p> <table class="table"><tr><td></td></tr></table> <p>para4</p> <p>para5</p> could someone please tell me how i can parse this html page to display ONLY para1, para2 and para3? and remove everything else. condition: i want to fetch all the content from the first <p> to the first <t...

Using the URI to create customer specific look'n'feel

There are customers that want to customize to brand my product, while have me conitue to manage and maintain the site. I have seen people doing this by creating customer specific URIs, such as: <customer1>.WebSite.com <customer2>.WebSite.com <customer3>.WebSite.com ... Each customerX identifier is obviously used to loa...

What are the best HTML+CSS compression methods?

Hi, I have an ASP.NET web application and I'm thinking about the following: before sending any HTML or CSS content to users, I wish to 'compress' them, then cache the result and send that to the clients. I know it is possible to compress these by removing whitespaces, comments and stuff like that, but I'm not really familiar with more ...

Creating a JSON object from multiple form fields using jQuery

Hi guys, I am trying to create a JSON object from a bunch of grouped HTML elements, this is my markup, HTML: <div id="locations_wrapper"> <div id="location_0" class="locations"> <div class="container"> <label for="locations_province">Province: </label> <div> <select id="locations_province" n...

Finding number of lines in an html textarea

I'm writing a mobile web application where scrollbars are not displayed on the device's browser. Due to this, I'm trying to dynamically modify the height of the textarea to make it bigger, however I don't know of any way to actually get the line count on an html textarea. Any help would be greatly appreciated! EDIT So I realize now t...

HTML divs: Auto height and overflow: auto?

I am trying to design a site which includes a content area with overflow: auto and a dynamic height. Preferably, I'd like to be able to put a header up top and a footer down below the overflow: auto div, and have that div take up the rest of the space, but so far this has proved difficult. Height: auto doesn't work, and overflow: auto re...

HTML5: write text on canvas

Is it possible to write text on HTML5 canvas? I've googled for that, found some workaround but no good description... Please advise, thanks! ...

How to remove the insignificant whitespace in a XmlNodeType.Text node?

I have an html node: <p>Line1 Line2 Line ThereAreTwoSpacesAfterThis ThereAreTwoSpacesBeforeThis </p> In any browser, the final use result is Line1 Line2 Line ThereAreTwoSpacesAfterThis ThereAreTwoSpacesBeforeThis which is the result I want. So how to remove the insignificant whitespace in a XmlNodeType.Text node (C#)? =========...

How to count the number of <li> returned through ajax using Javascript?

I have a ajax code which returns the list items as <li>one</li> <li>Two</li> Each time it will return different number of <li>'s. I want to check the number of <li> it returns. How to check it using Javascript. Please Help. ...

redirecting to next page

I wrote a javascript function to go to a particular page if it came from a particular page. Function: function proceed() { if( document.referer == "http://abcd.com/index.php?action=SignUp") { return document.location.href = "http://abcd.com/editprofile.php?action=editprofile"; } } Submit button for a form in current page(b...

HTML toggle button for simple site using php possible?

I've got a simple website using plain HTML/CSS to display and PHP/MySQL for data storage. Now I'd like to add a toggle button similar to facebooks "like" button. How can I act on the user pressing the button (add database record for this item, change button text) without leaving the page? I thought this question would have been asked ...

Html DIV and SPAN tags

Hi all.. Can I make DIV tag function as SPAN tag? i.e., removing line-break before and after the DIV tag. ...

How to append a <li> as the first list item in a <ul>

I have a html page (index.html) which calls the ajax page(aj.php). The Ajax Page will return some number of <li>'s, like <li>Blue Flower</li> <li>White Assassin</li> I already have some list items in the <ul> of the html page(index.html). When i try to append the result of the ajax page i.e.,<li>'s, it is appending at the last. I wa...

Linebreaks and Spaces appearing in TextAreas

In our Cocoon environment we have a few forms with textareas. Once the user submits a form, an overview is displayed before the final submit is done. Therefor, each form-object's data is stored in POJOs. If the user is on that overview page and decides to go back to the form, the form is filled with the already submitted data read from t...