when using JQuery, HTML, PHP is mandatory to make your web pages validate even when JQuery, HTML and PHP can sometimes cause havoc as well as being backwards compatible,
Is there a way to tell if an element is either hidden or is currently in the process of hiding (via an animation)? The only way I can think to do it is to store a flag in the element's data when you call show or hide, but I was wondering if there was another way?
I am trying to get a feel for adding content to a page with XMLHTTPRequest. I would like to add the results to existing page content say in a second column, but I am not having any luck. I would appreciate a shove in the right direction. Thanks for any help.
<!DOCTYPE html>
<html>
<head>
<style>
#button{
float: left;
}
#team{
float: left;
}
</style>
<title>XMLHTTPRequest</title>
<script src="jquery-1.10.2.js"></script>
<script>
$(document).ready(function(){
xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (xhr.readyState == 4 && xhr.status == 200) {
xmlDoc = xhr.responseXML;
var team = xmlDoc.getElementsByTagName("teammember");
var html = "";
for (i = 0; i < team.length; i++){
html +=
xmlDoc.getElementsByTagName("name")[i].childNodes[0].nodeValue + "<br>" +
xmlDoc.getElementsByTagName("title")[i].childNodes[0].nodeValue + "<br>" +
xmlDoc.getElementsByTagName("bio")[i].childNodes[0].nodeValue + "<br><br>";
}
//this is the code I would like help with
var team = document.getElementById("team");
team.appendChild(document.createTextNode("html"));
}
}
xhr.open("GET", "team.xml", true);
});
</script>
</head>
<body>
<div id="button">
<button onclick="xhr.send()">Click Me!</button>
</div>
<div id="team">
</div>
</body>
</html>
Hi!!
I'm facing an issue here. A customer asked me to copy an exact site, and even though I'm trying to convince him of going for a new design he does not accept it. He loves this design so much (on a side note it's horrible and outdated, but I wouldn't say that to him!)
It's been a couple of weeks since we are discussing this and I don't know what to do. Do you have similar experiences? I don't want to lose the customer, he pays well and his jobs are really easy. At the same time, I don't want to put my signature on someone else's work.
Any suggestions? Similar experiences? Thank you!
Hi, i'm not sure to explain what i'm looking for.
What's the name of the "source code parser" for publish code, in HTML ?
For example, when i write some source code here in stack overflow, system auto-detect the sintax and write "correct" source code in html.
I've noticed that exists the HTML <"code" tag, but it simply write source code in "courier" font.
So i'm asking you if exists some "external" component that, given a text, parse it out correctly in a HTML page.
Thank you!
I want to right-align an inline element to the right of a div. I have seen float="right" applied on a span to right align it but it seems semantically incorrect to me as floats are supposed to move "boxes" or block elements to the right or left of a container element.
Is my understanding of Float wrong or is there another way of right-aligning inline elements in a container DIV.
I have difficulty making an Excel-readable file from a table on a Website.
The problems very specific to my question are:
I have to use IE 7 to access the site.
Excel is installed in another computer.
The site does not let me view the HTML of the table.
Normally, I would simply select the table I want and drag and drop it to Excel. Or, I would view the page source and copy the HTML data. Both do not work in this case.
Is there any handy tool out there?
With Dreamweaver, I use frames to define a left column menu, and clicking on each menu tab would change the html page displayed on the right frame. However, webdesign tools such as kompozer do not support frames.
1 - What is the best way to design a html personal webpage with such menu bars, without using frames ?
2 - If html is not enough, what other scripting languages would you recommend to learn for someone with Java background and have basic knowledge of html and css.
3 - What web-design tools would you recommend to build a personal website ?
The issue I am having is:
How do I go from a variable pointing at an element to using CSS selectors?
I want to make this work:
function highlight(table)
{$(table " > :even").toggleClass('highlight');}
where table is a reference to a table element.
I don't want answers that tell me to use $('#table') because that defeats the point of the generality I am trying to make.
Thanks
Direct question - How would I place certain objects or small text within a certain area. For example, how would I replace the following image with html/javascript.
--- I don't have enough reps to post an image :/ but try this URL - http://i.imgur.com/a3eWL.jpg
Big picture - I am trying to create a kml file for Google Earth that when the point is clicked, the balloon description window pops up and I can display my html formatted diagram showing where the satellites are at that instant. Google Earth and KML docs allow for pretty much any html formatting within it, so currently looking for a good way to do this.
Disclaimer: It has been a few years since i have done any html or javascript editing, so general examples and insight is greatful.
Thanks
I am creating an element with document.createElement().
Now how can I pass it to a function that only takes a Jquery object?
$("#id")
I can not use it, as the element has not been rendered in the page yet.
Before you say "oh no, not again" here I'm stating my case. I'm parsing part of HTML output and the only thing I'm interested in is name and value attributes of each <input/ tag. HTML is actually HTML fragment, may not be well-formed. I don't have DOM or HTML parser and I don't try to parse nested elements anyway. The problem is that I don't know the order or number of attributes so it could be <input name="foo" value="boo"/> or <input type="hidden" name=foo> or <input id=blah value='boo' src="image.png" name="foo" type="img"/>.
Is there a single regular expression that would get me values of name and value attribute in predictable order? I wouldn't have asked the question if I could assume that name attribute always precedes value but unfortunately this is not the case
I am trying to get the id of the clicked/shown element in fancybox. I have tried both "this.id" and "this.attr("id")" - but none of them works.
$("a.lightbox_image").fancybox({
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'speedIn': 600,
'speedOut': 200,
'content': 'Id of element clicked'+this.attr("id")
});
Any suggestions?
Is there a way to specify certain part of a html file as another encoding?
The default encoding for the (generated) html is utf-8. However, some of the included data to be inserted in the html is in another encoding. It's something like:
<div>
the normal html in utf-8
</div>
<div>
<%= raw_data_in_another_encoding %>
</div>
Is there a way to hint a browser to render the 2nd <div> in another encoding? thanks
Hi All,
I have created the HTML page for example page1.html with some setting onclick invoke page2.html
On Click Back button the page1 is getting loaded will all previous data. I want complete reload of page and donot want to remeber any setting.
Regards,
Dev
Hi,
Quick, hopefully easy question. Google is failing me. I don't want my text exactly centered. I want it maybe 7 characters (blank spaces) over. What do I add to this to do that? <.centerThis is centered<./center
Adding blanks in front of the "T" does nothing.
(I added the dots in the code above because I can't get <.code blocks/spans to let me put the html code here.)
(Nothing fancy - no CSS, DHTML, XHTML - just plain old HTML.)
Thanks.
I'm trying to fill a document with a SVG image using the width="100%" and height="100%"
properties, I have height="100%" in html and body tags too, and different colours for body(red) and svg(blue).
Result is a full height svg but with a scrollbar in the right, and a thin line of red(body) at the bottom.
¿How can I fill the document with the svg without the scrollbar? Thanks.
The code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SVG full page</title>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
background-color: #ff0000;
}
</style>
</head>
<body>
<svg width="100%" height="100%">
<rect x="0" y="0" width="100%" height="100%" fill="#0000ff"></rect>
</svg>
</body>
</html>
These days customer's retention is very difficult in almost every market. Same is the case with PSD to XHTML conversion service market. There are so many players in the market providing more or less same quality of mark up services at competitive prices so that it becomes almost impossible for the customers to select the best one for them.
The Internet is a billion dollar industry. Its popularity continues to increase as more people start using it for their day to day activities, such as researching, shopping, communicating and even banking. For those that want a slice of this industry, it all starts off with owning you own website.
I'm considering one selection statement that would target one of many css class names in a single class attribute value based on a string prefix.
For example, I want any detail- prefixed class names to get targeted from the following sample links.
<a href="eg.html" class="detail-1 pinkify another">
<a href="eg.html" class="something detail-55 minded">
<a href="eg.html" class="swing narrow detail-Z">
<a href="eg.html" class="swing narrow detail-Z detail-88 detail-A">
It's reminiscent of how [class|="detail"] prefix selector works on a scalar attribute value, and also of .hasClass(className), but my question needs both concepts applied simultaneously.
Note: The detail- prefix won't necessarily be the first class name of the bunch.
The question was asked to me in an interview.
How to find which element is clicked by the user in the DOM using JQuery or Javascript or Both?
NOTE: User can click on any element in the DOM whether it is an img, div or even span.
If you can suggest some example then it will be very much helpful.
Thanks in advance
Hi all,
I came cross a question in my interview.
Question:
Array of integers will be given as the input and you should find out the middle element when sorted , but without sorting.
For Example.
Input: 1,3,5,4,2
Output: 3
When you sort the given input array, it will be 1,2,3,4,5 where middle element is 3.
You should find this in one pass without sorting.
Any solutions for this?