I would like to add a preprocessor to HTML pages. Basically, I have a program that takes the name of an HTML file containing preprocessor instructions and outputs the contents of the file after preprocessing to stdout. This mechanism could change if it makes things easier. All I want to do is hook this into Apache so that all the file...
Can anybody tell me how to parse and edit HTML in PHP?
...
Hi.
I'm working on a program that downloads HTML pages and then selects some of the information and write it to another file.
I want to extract the information which is intbetween the paragraph tags, but i can only get one line of the paragraph. My code is as follows;
FileReader fileReader = new FileReader(file);
BufferedReader buffR...
Suppose I have the following HTML:
html = Four score and seven <b>years ago</b>
I want to parse this with Hpricot:
doc = Hpricot(html)
Find the <b> node:
node = doc.at('b')
and then get the character index of the <b> node within its parent:
node.character_index
=> 22
How can I do this (i.e., what's the real version of the cha...
Edit: I fixed the problem by just starting from scratch. Sorry to waste y'alls time. Please vote to close if you feel so inclined.
I'm having trouble getting the actual data in a form to submit when the input fields are added via javascript. The fields show up, and in the right place, but when I do a var_dump( fieldname) on the serve...
I've received from a design agency the following html to be displayed in a form on one of asp.net webapps:
<label>
<input type="radio" />
Label Text 1
</label>
<label>
<input type="radio" />
Label Text 2
</label>
<label>
<input type="radio" />
Label Text 3
</label>
You can imagine that the output produced wil...
Hi,
I'm trying to figure out just how a particular function works on a Facebook page, and being no friend of JS syntax, am having trouble. Here's the question mark bit:
<a href="#" clicktoshowdialog="my_dialog" onclick="
(new Image()).src = '/ajax/ct.php?app_id=4949752878&action_type=3&post_form_id=3b933f46f9c4c44981e51b90c754bfce&...
Hi guys, i have popup-window in my script. I use window.open, but almost all browsers block this kind of windows. So i wanna change it to another popup, which include php-script. I saw it at another sites. As i understand, they use ajax. Could you provide for me some more info?
...
Hello world,
Currently my program is in a spot where it both listens for the user to scroll a certain element, but also, at times, automatically scrolls this element by itself. (Not a gradual, pretty scroll, but an instant jump. It makes sense in context, I swear.)
Is there a way to make the scroll event not trigger if the scrolling wa...
Hi I would like to know a good HTML parser for both static and dynamic HTML in java. It needs to be light weight as it is to be used on a mobile application . Is there anything already present?
...
In order to put e-mail addresses on my sites, I use this Javascript:
function showEmailLink(user, domain, linkText) {
if (linkText == "") {
linkText = user + "@" + domain;
}
return document.write("<a href=" + "mail" + "to:" + user + "@" + domain
+ ">" + linkText + "<\/a>");
}
so that in my HTML I can write this:
please send m...
I'm using the excellent BeautyTips plugin as a means of indicating validation failures to end users and I'm running into positioning problems whenever page content is dynamically added, removed, or animated.
Here's a concrete example. I have a DIV at the top of each page that’s used for confirmation/error messages. It's displayed in $...
I have an HTML page that uses AJAX to retrieve messages from a server. I'm appending these messages to a as they are retrieved by setting its innerHTML property.
This works fine while the amount of text is small, but as it grows it causes Firefox to use all available CPU and the messages slow down to a crawl. I can't use a textbox, bec...
I have a class that stores paths to CSS and Javascript files in arrays. This class also compiles my final page HTML output (which is stored in an $output variable). I want to loop through my $css and $js arrays and inject HTML at specific points in $output. The CSS files would need to go right before </head> and the JS files would need t...
Hi all,
In my CMS I've added this code <div><?php include("my_contact_form.php") ?></div> which updates to a db. I can see it there OK.
I have this php code in my display page after the db call:
$content = $row['content'];
when I echo $content inside the body this is displayed in the HTML source:
<div><?php include("my_contact_form....
In my application I want to open some files with the correct default programmes, like .doc file should be open with WORD and .psd files should be opened with Photoshop if it is installed, and this should be done under html or java script.
Please tell me how to do it.
...
Hi,
I have written a simple CRUD form which has one select list. However the value from the select list doesnot seem to get passed to the database. it get passed when I am using a simple text box. What is the possible error? Please point out
<?php
include('config.php');
if (isset($_POST['submitted'])) {
foreach($_POST AS $key => $value...
Hello I have two php file. One of them builds a report, the second contains the language text. When it prints, it keeps giving me the � special character everywhere, even if I am not using any special characters in my code. Why is that and how can I get rid of those?
I am running Apache 2.2, php 5, Ubuntu 8.04.
FILE 1
<?php
function g...
Is this the right way to do a nested navigation?
<dl>
<dt>Struktur</dt>
<dd>
<ul id="structure">
<li><a href="/module/structure/add">Hinzufügen</a></li>
<li><a href="/module/structure/index">Auflisten</a></li>
</ul>
</dd>
<dt>Nachrichten</dt>
<dd>
<ul id="messages">
<li><a href="/module/messages/add">Schreiben</a...
This is my markup, I need to align gray label under the blue label and keep the number aligned with blue label.
CSS:
body
{
font-family: arial, helvetica, sans-Serif;
}
#talkbacks .noshow
{
clear: both;
display: table; /*padding-left: 14px;*/
line-height: 13px;
width: 439px;
}
#talkbacks ul.top
{
border: sol...