html

Java - retrieve HTML page in proper encoding

Hi all! How can i read http stream with HTML page in page's encoding? Here is a code fragment i use to get the http stream. InputStreamReader has the encoding optional argument, but i have no ideas about the way to obtain it. URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); BufferedReader d = new Buffer...

tinymce and importing / copy paste from microsoft word

i am struggling to get an accurate answer on this questions on whether tinymce supports pasting from microsoft word. i guess there may be a lot of out of date information on the web on this topic as i have seen answers such as: There is a plugin you can install to get it to work You have to use a seperate "paste from word" button as o...

What is the best way to strip out all html tags from a string?

Using PHP, given a string such as: this is a <strong>string</strong>; I need a function to strip out ALL html tags so that the output is: this is a string. Any ideas? Thanks in advance. ...

div or iframe over an applet

Hi guys, I want to create a custom video control, I mean over the video itself, with issues like double click on some x and y coordinates of the video to zoom In, but I can't get this result because the real player plugin API is not that flexible, then I Tried to create a transparent layer to handle those events and I can't achieve that ...

Elements stack, but unstack when hovered?

Basically my problem is sometimes, divs, spans, will float on top of ecahother. But when I move my mouse over them they "unstack" and correct themselves, and they will stay fixed until I refresh the page... then they are broken again. It's as if the action of hovering over them does something to it? Does anyone know why this kind of beh...

Can I make spaces between HTML tags not screw up relative positioning?

There is a line break between two <img> tags, and they are indented in the document for nice-formatting. But I'm using relative positioning and z-order to place one image (part of the layout) overtop of another. I have something like this <img style="position: relative; z-index: -1;" width=a height=b> <img style="position: relative; z...

CSS - Border only inside the table

I am trying to figure out how to add border only inside the table. When I do: table { border: 0; } table td, table th { border: 1px solid black; } The border is around the whole table and also between table cells. What I want to achieve is to have border only inside the table around table cells (without outer border around the...

File:// link doing nothing in all browsers

I have a link being generated that looks like so: <a target="_blank" title="Test" href="file:///c:/test.xls">Test</a> This link is inside an iframe. When I click on it (in any major browser), nothing happens. Fiddler records no traffic. Pasting the URL into the nav bar works fine - the file download box comes up, and I can download ...

regular expressions and xpath query

Hello I have the following code <?php $doc = new DOMDocument; $doc->loadhtml('<html> <head> <title>bar , this is an example</title> </head> <body> <h1>latest news</h1> ...

Make <tr> to act like <a>

I have a table and I want every row to be clickable. Right now, I'm doing the simple: $('tr').click(...) This works for the most part but how can I make it act like a link in these ways: Shift-click opens the target in a new window Middle clicking opens the target in a new tab Hovering shows the link address in the status bar ...

How to switch web app from HTML to Markdown?

I've got a django-powered site. Currently, all of the textfields are just plain old text inputs that take raw HTML. I have no fancy editor or anything. I would like to start using Markdown and WMD to make things easier for everyone. Do I have to run some sort of script to go over every text field in the database to convert all the HTML...

Cleaning all inline events from HTML tags

For HTML input, I want to neutralize all HTML elements that have inline js (onclick="..", onmouseout=".." etc). I am thinking, isn't it enough to encode the following chars? =,(,) So onclick="location.href='ggg.com'" will become onclick%3D"location.href%3D'ggg.com'" What am I missing here? Edit: I do need to accept active HTML (I...

Word-wrap in a html table

I've been using word-wrap: break word to word wrap text in divs and spans, but it doesn't seem to work in table cells. I have a table set to width=100%, with one row and two columns. Text in columns, although styled with the above word-wrap attribute, doesn't wrap and causes the text to go past the bounds of the cell. Any suggestions...

Harden url passing to another page using parameter

i want to pass parameter to another page through iframe example <iframe src="http://otherserver.com/page?user=user_id"/&gt; rather than passsing user= id this way, is there any technique so that user will not aware of user=user_id ? ...

How can I display an image using the "em" unit?

I've created a <div> with width:10em and height:5em. Now I would like to display an <img> (GIF image) in this <div> with the exact same size. But apparently it doesn't "know" the em unit. It shows the picture in 10x5 pixels instead. How can I display this <img> using the "em" unit? ...

Get element at specified position - JavaScript

Using Javascript how can I identify the element at a given position? Basically I'm looking to write a function that takes two input parameters (the x and y coordinates) and returns the html element at the position on the screen represented by the parameters. ...

Adding ids to HTML tags for QA automation

I have a query In our application we have lots of HTML tags. During development many tags were not given any id because of no requirement.Now the QA team wants to automate the test cases using QTP. In most of the cases this tool doesn't recognizes because it does not find ids for most of the HTML tags.Now we are asked to add ids to all t...

Html file upload preview by Javascript

I want to show a PREVIEW kind of thing for an post , so took details by JS but problem comes when it comes to <input type="file" , it's not giving full path to the file Ex: if I do $("#image").val(); it only give "Sunset.jpg" not C:\Documents and Settings\All Users....\Sunset.jpg any idea how to get that detail value? ...

Can I use javascript to change the language?

I have a textbox that I want to the user to write something in it. I want that the default language there would be english. so if he pressed alt-shift before he came to my page and he is now on other language - when he'll come to my textbox it would change his language to english. Is it possible with javascript? how? ...

Expand div to take remaining width

I want a two column div layout, where each one can have variable width e.g. <div style="float:left">Tree</div> <div style="float:left">View</div> I want 'view' div to expand to whole width available after 'tree' div has filled needed space. Currently my 'view' div is resized to content it contains It will also be good if both divs tak...