html

JavaScript: Banner code changing

I want to change the behavior of a JavaScript used to display a banner, coming from a central source. Today I include a script-tag inline in code, like this: <script type="text/javascript" src="http://banner.com/b?id=1234"&gt;&lt;/script&gt; But what that returns is code which uses document.write, like this: if(condition) { docu...

Regular expression for extracting tag attributes

I'm trying to extract the attributes of a anchor tag (<a>). So far I have this expression: (?<name>\b\w+\b)\s*=\s*("(?<value>[^"]*)"|'(?<value>[^']*)'|(?<value>[^"'<> \s]+)\s*)+ which works for strings like <a href="test.html" class="xyz"> and (single quotes) <a href='test.html' class="xyz"> but not for string without quotes: <...

How can I change HTML attribute names with jQuery?

I would like to change all the names of the attributes where class="testingCase" throughout all my whole html document. e.g. Change: <a class="testingCase" href="#" title="name of testing case">Blabla</a> <a class="testingCase" href="#" title="name of another testing case">Bloo</a> To this: <a class="testingCase" href="#" newTitleN...

Don't show iPhone keyboard for a particular textbox in web page?

Is there any setting using which the iPhone keyboard won't appear for a particular textbox in web page? May be some css kind of setting? ...

Easiest way or Best tools to convert word text to clean (X)HTML

This might have been asked in another way. I am not doing it on the fly however. Once in a while we get pieces of content in word files that have em dashes, bold, italic text and block quotes. Is there a good tool to convert this into a clean html code. Otherwise what other approaches people take. ...

How do I set the margin of an object with javascript?

I am trying to set the margin of an object from JavaScript. I am able to do it in Opera & Firefox, but the code doesn't work in Internet Explorer. Here is the JavaScript I have: function SetTopMargin (ObjectID, Value) { document.getElementById(ObjectID).style.marginTop = Value.toString() + "px"; } And it is called like this: Se...

What's the most bullet-proof way to upload large files in a web app?

We have to accept large file uploads (video content) and want to do that in a way that works well across all standards-compliant browsers and plug-ins. Our current setup looks like this: SWFUpload input type="file" for graceful degradation On the server-side, we have nginx and the upload module streaming the uploaded files into the s...

UI to indicate a "Partially-required" field in web form?

I have a set of radio buttons where a selection is required. In addition, there is an optional text box that shows up next to one of the selections. What would be the best way to make it clear what is required and what is optional? <strong>User Availability:</strong><br> <input value="Available" type="radio"> Available<br /> <input va...

Build hierarchical html tags in PHP from flat data.

How do you build a hierarchical set of tags with data in PHP? For example, a nested list: <div> <ul> <li>foo </li> <li>bar <ul> <li>sub-bar </li> </ul> </li> </ul> </div> This would be build from flat data like this: nested_array = array(...

Extracting Information from websites

Not every website exposes their data well, with XML feeds, APIs, etc How could I go about extracting information from a website? For example: ... <div> <div> <span id="important-data">information here</span> </div> </div> ... I come from a background of Java programming and coding with Apache XMLBeans. Is there anything simil...

displaytag: suppress zeros in HTML table

Hi, I have a HTML table that's generated in a JSP by the displaytag tag library. I would like to suppress any zeros that appear in the table, i.e. they should be replaced by a blank cell. Is there any straightforward way to achieve this? Cheers, Don ...

HTML Link opening a page that Redirect to a Quicktime .MOV file displays garbage characters in IE when Target is _blank

Hi, I have a .NET page that does a Response.Redirect to a Quicktime .mov file. When I create a link to this .NET page, if the link opens in the same window (i.e. no Target defined on the anchor tag), all is good and IE displays the Quicktime movie just fine. However if I set the Target of the link to "_blank" which opens a new window, I...

C# - WebRequest Doesn't Return Different Pages

Here's the purpose of my console program: Make a web request > Save results from web request > Use QueryString to get next page from web request > Save those results > Use QueryString to get next page from web request, etc. So here's some pseudocode for how I set the code up. for (int i = 0; i < 3; i++) { strPageNo...

Cross domain Ajax request from within js file.

Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a js file www.foo.com like this... <script type="text/javascript" src="http://www.foo.com/jsfile.js" /> 3.) "jsfile.js" uses Prototype to make an Ajax request back to www.foo.com. 4.) The ajax request calls www.foo.com/blah.html. The callba...

tutorial for HTML canvas's arc function

I can not figure out what all the parameters to the arc() function are (by experimentation) and I have not found any tutorial that seems to explain them. Where would a good explanation of the arc() function be? ...

Replacing header text with an image

I am working on setting up a Drupal based website and wanted to replace the site title in the header with an image file. I came across this article: "Revised Image Replacement" summarizing several techniques for doing just that. I was wondering what the current best practice is, in terms of SEO and browser compatibility? ...

escaping html inside comment tags

escaping html is fine - it will remove <'s and >'s etc. ive run into a problem where i am outputting a filename inside a comment tag eg. <!-- ${filename} --> of course things can be bad if you dont escape, so it becomes: <!-- <c:out value="${filename}"/> --> the problem is that if the file has "--" in the name, all the html gets scre...

manipulating css layers with javascript

Hello, I am wondering if it is possible to have a sort of thumbnail image gallery, in which clicking on a thumbnail would show the full image in a layer. I was wondering if it was possible to load all layers and respective images and use javascript to change the z index or something similar to avoid having to reload or leave the page. I...

Best html editor for a non technical user.

I have set up a simple web page for a family member and now they want to be able to edit the page themselves. My primary web authoring tool is gvim which is obviously out of the question for a non techie. Does anyone have any recomendations for a simple effective WYSWYG html editor There are no requirments for javascript, forms, or an...

css: Should I limit the use of universal selectors (*.classname vs a.classname)?

I have a question about css selectors. Say I have the following html <div class="message"> <div class="messageheader"> <div class='name'>A news story</div> </div> </div> In the css I could refer to the class called name either like this div.message div.messageheader div.name {} or .name {} /* ie *.name{} */ Is one way ...