
Sharon asks…
Help with html code please!?
So far this html code loads up a music player with 4 panes. The first pane loads an XML file with the artist and the title of the album concatenated.
I need to know how get the tracks of the artist to appear on the second iframe and the song to be on the third iframe and ready to play.
Please help..if you need to know anything about the xml file please ask because i can’t fit the content of it on here. But the tags the xml file has are “albums”, “album”, “title”, “artist”, “artwork” and “track”
Please see if you can help!
Thanks
title>Mi Tunes
body {
font-size: 2.5em;
background:white;
}
iframe{
font-family: Arial;
font-size: xxlarge
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js” type=”text/javascript”>
function XMLload(){
jQuery.post(url,function(data){getxml(data);},’xml’);
}
function dataFromTag(node,t){
var d=node.getElementsByTagName(t);
if(d.length==0)
return(”);
return(d[0].firstChild.nodeValue);
}
jQuery(document).ready(function(){XMLload();});
// all the code above this line can be re-used without change
// all the code below will need altering for a different document and different structure
var url=’music.xml’;
var xmlalbums;
function getxml(xmldoc){
xmlalbums = xmldoc.getElementsByTagName(‘album’);
var hstr = ”;
hstr += ‘
Albums
for( var i = 0; i < xmlalbums.length; i++ ) {
hstr += ” + dataFromTag(xmlalbums[i], ‘artist’) + ” ” + dataFromTag(xmlalbums[i], ‘title’) + ”;
}
hstr += ‘
‘;
with( document.getElementById(‘pane1′).contentDocument ) {
open();
write(hstr);
close();
}
}

Administrator answers:
My advice would be to use jQuery media plugin.
You can set it to load the contents of the iframe panes dynamically by just calling the plugin in the load event.
Http://www.jquery4u.com/media/8-jquery-media-plugins/
Hope this helps.

Lizzie asks…
How to expand and collaps all the divs?
How can I collaps and expand all the divs at onece for the following code?
<script type=”text/javascript” src=”jquery.js”>
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js” type=”text/javascript”>
$(document).ready(function(){
//hide the all of the element with class msg_body
$(“.msg_body”).hide();
//toggle the componenet with class msg_body
$(“.msg_head”).click(function()
{
$(this).next(“.msg_body”).slideToggle(100);
}).toggle( function() {
$(this).children(“span”).text(“[-]“);
}, function() {
$(this).children(“span”).text(“[+]“);
});
});
Testing JQ
[+] Header-1
[+] Header-2
[+] Header-3
Thanks to you all

Administrator answers:
You will have to add an ID to your divs, and, under javascript, use
var x = document.getElementById(“mydiv”);
x.style.height = 0px;
x.style.width = 0px;
for all and every div you want to collapse.
However, in doing so, you will definitely screw-up all your page!
Good luck!

Ruth asks…
Basic javascript help.?
I am trying to do a live search field and I can’t seem to get it to work! Here is my code do you see any flaws in it? Thanks.
INDEX.HTML
<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js”>
function getStates(value) {
$.post(“getStates.php”,{partialState:value},function(data) {
$(“#results”).html(data);
});
}
GETSATES.PHP
<?php
mysql_connect(“XXX”, “XXX”, “XXX”) or die (‘Error connecting to mysql’);
mysql_select_db(“XXX”) or die(mysql_error());
$partialStates = $POST['partialState'];
echo $partialStates;
echo ”
“;
$query = “SELECT * FROM posts WHERE content like ‘%$partialStates%’”;
$states = mysql_query($query);
while($state = mysql_fetch_array($states)) {
echo $state['content'];
echo ”
“;
}

Administrator answers:
Anywhere you have writen $POST it should be $_POST
http://www.liveanime.org

Thomas asks…
Need help with Tumblr!?
Well, I found this code on the web:
#preloading {
background: #fff url(“http://static.tumblr.com/3driglx/tQYl1k62u/themanati_body_background_light.png”);
height: 100%;
left: 0;
overflow: hidden;
position: fixed;
top: 0;
width: 100%;
z-index: 9999;
}
#preloading #loader {
background: url(“http://static.tumblr.com/3driglx/Uvilbpz38/loading.gif”);
display: block;
height: 79px;
left: 50%;
margin-left: -148px;
margin-top: -40px;
position: absolute;
top: 50%;
width: 295px;
}
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js” type=”text/javascript”>
$(document).ready(function() { $(‘#preloading’).fadeOut(4500); });
$(document).ready(function() { $(‘#container’).fadeIn(3000); });
document.write(‘
’);
I want to show a “LOADING” message on my tumblr blog just like this one:
http://hayleybrehanne.tumblr.com/
But I don’t know where to put each piece of the code. HELP ME PLEASE!

Administrator answers:
Sorry, that’s really hard to understand. Why don’t you click “Contact Us” on Tumblr or something and ask someone who may have a clue?

David asks…
Who is good with Javascripts?
I need help with this script
<script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js”>
function format_this_text(text){
var formatted_text = “”; var line = “”;
var max_char_per_line = 100;
var number_of_lines = parseInt(text.length / max_char_per_line);
var char_pointer = 0;
var i = 0;
for(i=0;i<=number_of_lines;i++){
line = text.substr(char_pointer,max_char_per_line);
formatted_text += ” n”+line;
char_pointer += parseInt(max_char_per_line);
}
return formatted_text;
}
Its a script to limit the characters in a textarea
Somehow when i type on the textarea it cuts off some of the words for example..
Three hundred years ago, a group of pow
erful beings arrive in our shores
As you can see it cuts off the word “powerful”
Is there anyway to prevent it from happening? (Not cutting words)

Administrator answers:
Too lazy right now to work this into the code but the logic is:
If the last character of the line is not a space,
go to the last instance of a space character in that line and add it to the beginning of the next line.
Powered by Yahoo! Answers

















