html

Scraping a messy html website with PHP

Hi all, I am in the following situation. I am trying to convert a messy scraped html code to a nice and neat xml structure. A partial HTML code of the scraped website: <p><span class='one'>week number</span></p> <p><span class='two'>day of the week</span></p> <table class='spreadsheet'> table data </table> <p><span class='two'>anoth...

event calling before page unload..

i want to pop up a dialog before a html page is unloaded asking to unload page or not if yes is selected then unload continues else if no is selected unload event is canceled... ...

How to scroll a <li> while appending it into group of <li>

I have a Div Container which holds 4 <li> what I am doing is prepend a <li> into the <ul> and remove the last <li> I did that quite easily using $('#news-ul li:last').remove() $('#news-ul').prepend(str); //str contains a <li> I want to have scroll effect when the <li> is prepending. How to achieve this. Plz help me, any help will b...

HTML Fixed Container

I have created a spreadsheet like web app and now need to have cell size fix so that text inside the cell shouldn't increase the width or height of the cell. You can view it here http://i56.tinypic.com/4rw948.png. The cells are basically elements having two columns as and needs to be fixed so that every cell is of equal size. I don't...

Checkbox onclick javascript do not make the file upload element empty in IE

I have a checkbox and a file upload element, they both are dependent on each other such that if on is on that other has to be off(empty in case of file upload field) for this i have used the javascript on onclick of checkbox and onchange of file upload.. For onchange event the checkbox gets deselected in all browsers but after i sele...

How to access text from neighboring table cell?

I have a set of search results presented in a table. Each row has a radio box. Once the user has selected a row I would like to access the description text from the neighboring cell. Using jQuery or straight javascript, what is the best way to do this? <tr class="odd"> <td class="chosenCode"><input type="radio" value="123" name="chos...

Weird mapping of DOM elements into variables

Today a workmate was working on a third-party video player integration for a set-top-box and found in their documentation an example like this: <a id="say_hello">Hello</a> <script type="text/javascript"> say_hello.onclick = function() { alert("Hello world") } </script> I just suspected it was something related only with CE-HTML but...

Decode &amp; back to & in javascript

I have strings like var str = 'One &amp; two &amp; three'; rendered into HTML by the web server. I need to transform those strings into 'One & two & three' Currently, that's what I am doing (with help of jQuery): $(document.createElement('div')).html('{{ driver.person.name }}').text() However I have an unsettling feeling that ...

problem: onclick event in dropdown

Hi all, I have a dropdown menu and all i want is that when i click on Italian in the dropdown, the content for italian will show... Basically what i want is to set the action to IT when i select Italian from the dropdown.. Any help please?? <% action = Request.QueryString("action") %> <form name="contentchanger" action="/...

Changing attributes of cloned elements using CSS selectors

Hi guys, I am trying to clone an element, and then traverse through it's child elements and change attributes accordingly, the thing is that I am trying to access the elements via custom attributes using CSS selectors and I can't seem to get it to work, here is what I have thus far, HTML: <div id='main_container'> <div id="contain...

Sending a application/x-www-form-urlencoded list on html

I need to send an HTTP Post request to a RESTful service written in Java and uses Jersey. My java function that handles request is like that: @POST @Consumes("application/x-www-form-urlencoded") public Response update(@FormParam("items") List<String> items) { ... } How can a create a request on html and send it, so that they are pa...

Two divs positions

Hello, I'm using google maps for the page. I have to set up the layer with map with 100% height in 100% width minus 200 px for the toolbar to the left: <div id="toolbar" style="float: left;width: 20%">left</div> <div id="map" style="float: left;width: 80%;height: 100%;"></div> This code works, but the toolbar resizes. And I need only...

hidden invisible elements take space

I'd like to make some empty hidden elements (iframes would be nice, paragraphs would do) that java script would later fill and modify. I have not been able to figure out how to keep these elements from taking up space. I've turned off margins and padding and set height to zero but still end up with blank space. I'd like to see an exam...

SEO - Special chars in title and alt attributes

Hello. Are special chars like &aacute; in alt and title attributes a problem for SEO? Thanks! Diego ...

Formatting and manipulating text input forms with php

Hi everyone. I'm pretty new to PHP, sorry for the newb question :-) I'm building a website and I want the client to be able to manipulate everything on it, including the text for pages such as FAQ, Terms and Conditions etc. Basically there will be an admin page with a textarea input form, and the admin will upload/edit the content to a...

Creating fancy HTML buttons with images

I'm using a customized <img> element as a button on my site (with onclick for the form submit). The reason being I want the element to display one image when the button is up and another for when the button is down. I'm using onmousedown and onmouseup for that. This is an AJAX-based site, and the submit is also AJAX-y. It is safe to ass...

What's the correct jQuery selector for this? I want to get all tr with attr x, which are directly beneath (same level) given tr.

Hi all, I'm currently working on something like a tree, and I want to be able to fold/unfold children. I guess the most easy way to get this is by using nested lists, but I can't use them because I don't have access to the HTML code. This is the relevant simplified HTML code: <table> <tbody> <tr rel="1"><td><a href="#" id="...

Writing a custom text box for web pages.

I want to capture user's activities on my textbox. Since a normal textbox won't give me enough information on what my user is doing currently with it, I want to start on a custom HTML text box. For e.g. If my user is typing Hello world! (Say he made a typo...) I should be able to tell him that, H e l l o w o r l e [bksp] d ! also if a...

Displaying a popup for a table cell

I have a table and want to have a message box appear when users click on specific cells. I want the message boxes to overlay the table but be visually connected to the specific cell which was clicked. For example, I might style then like speech bubbles and position them so they appear to be joined to the clicked cell. Usually, I would a...

Get selected text outside textbox with jquery

Is it possible to retrive selected text outside textbox? I had seen solutions to get text from input forms and textareas, similar to this: http://laboratorium.0xab.cd/jquery/fieldselection/0.2.3-test/test.html but can this aplied on HTML text (inside div element)? For example, I want user to be able to bold selected text which is not in...