Jump to content

jenni_fur

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jenni_fur's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey I have used the document.all function as part of an image gallery i am developing. Althought it works fine in IE and Mozilla, i have discovered it is not supported by Safar. What is the best method to correct this problem. Here is my code, I'm a javascript newbie...so i basically don't have a clue what to do. As you can see it is combined with PHP so ignore all the extra slashes, i pretty much just want to fix it for Safari "<a href ='#' onClick="; "\"document.the_image.src="; "'$large_dir$photos_large[$i]' ; document.all.ref.innerHTML='Ref: $photos_large[$i]'"; "\">"; <div id = \"ref\">Ref: $photos_large[1]</div>";
  2. yeah, i dont think i explained myself very well. Sorry i have built a content management system to edit and update a site i'm working on, however if i input over 1000 characters into any particular field, it will only display the amout of characters in excess of the 1000 character limit. At first i thought this was a simple html css problem, however on closer inspection, when i upload new info to the xmi via my content management system, it does actually work, however once i view it on the public site, only the excess characters show. would it help if i posted the code that is supposed to print the content from the XML?? this is it below [code] <?php include "./homeparser.inc"; ?> <?php include "./homearray.inc"; ?> <div id="home"> <?php echo "<h1>"; for( $i=0; $i < $lengthOfArrayHome; ++$i ) { $thisNameHome = $person_data_home[$i]["welcome"]; echo $welcomeContent=$thisNameHome."<br>"; } echo "<br>"; echo "whats new.."; echo "</h1>"; ?>    <?php echo "<h4>"; for( $i=0; $i < $lengthOfArrayHome; ++$i ) { $thisNameHome = $person_data_home[$i]["newinfo"]; echo $newinfoContent=$thisNameHome."<br>"; } echo "</h4>"; ?> <?php echo "<h2>"; for( $i=0; $i < $lengthOfArrayHome; ++$i ) { $thisNameHome = $person_data_home[$i]["main"]; echo $mainContent=$thisNameHome."<br>"; } echo "</h2>"; ?> [/code]
  3. hey, i actually have a number of problem with a project i'm working on but at the moment this is the most frustrating. Two problems, firstly if I input over 1000 charasters to my xml file, in any particular field, it crashes! and secondly when i use anything like <>/""'' it crashes too! my attempt at using CDATA! scritp thus far has been unsuccessful and i woud be greatful for some input....! this is the parser [!--sizeo:1--][span style=\"font-size:8pt;line-height:100%\"][!--/sizeo--] [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]EDIT-Zanus: Put code, especially long code into the code tag to make it easier for people to read please[!--colorc--][/span][!--/colorc--][!--sizec--][/span][!--/sizec--] [code]<?php if( ! ($fp = fopen( "./home.xml" , "r" )) )   die("Couldn't open xml file!"); $person_counter_home = 0; $person_data_home = array(); $xml_current_tag_state_home = ''; function startElementHandlerHome( $parser_home, $element_name_home, $element_attribs_home ) {   global $person_counter_home;   global $person_data_home;   global $xml_current_tag_state_home;   if( $element_name_home == "STORY" )   {    // $person_data_home[$person_counter_home]["author"] = $element_attribs_home["AUTHOR"];   }   else   {     $xml_current_tag_state_home = $element_name_home;   } } function endElementHandlerHome( $parser_home, $element_name_home ) {   global $person_counter_home;   global $person_data_home;   global $xml_current_tag_state_home;   $xml_current_tag_state_home = '';   if( $element_name_home == "STORY" )   {     $person_counter_home++;   } } function characterDataHandlerHome( $parser_home , $data_home ) {   global $person_counter_home;   global $person_data_home;   global $xml_current_tag_state_home;   if( $xml_current_tag_state_home == '' )     return; if( $xml_current_tag_state_home == "HOMEPAGE" ) {     $person_data_home[$person_counter_home]["homepage"] = $data_home;   }            if( $xml_current_tag_state_home == "WELCOME" ) {     $person_data_home[$person_counter_home]["welcome"] = $data_home;   }   if( $xml_current_tag_state_home == "MAIN" ) {     $person_data_home[$person_counter_home]["main"] = $data_home;        }   if( $xml_current_tag_state_home == "NEWINFO" ) {     $person_data_home[$person_counter_home]["newinfo"] = $data_home;        }   if( $xml_current_tag_state_home == "IMAGE" ) {     $person_data_home[$person_counter_home]["image"] = $data_home;   }   if( $xml_current_tag_state_home == "ALT" ) {     $person_data_home[$person_counter_home]["alt"] = $data_home;   }    } if( !($xml_parser_home = xml_parser_create()) )   die("Couldn't create XML parser!"); xml_set_element_handler($xml_parser_home, "startElementHandlerHome", "endElementHandlerHome"); xml_set_character_data_handler($xml_parser_home, "characterDataHandlerHome"); while( $data_home = fread($fp, 4096) ) {   if( !xml_parse($xml_parser_home, $data_home, feof($fp)) )   {     break; // get out of while loop if we're done with the file   } } xml_parser_free($xml_parser_home); ?> <?php $article = $homepageContent; $thisPos_home = -1; $lengthOfArrayHome = count($person_data_home); for( $i=0; $i < $lengthOfArrayHome; ++$i ) { $thisName_home = $person_data_home[$i]["homepage"]; //echo $thisName_home. "<br>"; if ($thisName_home == $article) { $thisPos_home = $i; } } //unset($person_data_home[$thisPos_home]); $elementPos_home = 0; if ($thisPos_home==-1) { $elementPos_home = $lengthOfArrayHome; } else { $elementPos_home = $thisPos_home; } ?>[/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.