SlideShare a Scribd company logo
−> Ajax using prototype.js blinks image but doesn't display it... Help

−> Ajax using prototype.js blinks image but
doesn't display it... Help

Source: http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.javascript/2010−01/msg01335.html



      • From: Steve JORDI <stevejordiK__I_L_LSP_AM@xxxxxxxxxxx>
      • Date: Thu, 21 Jan 2010 15:04:46 +0100

Hi,
I'm trying to implement a tabbed container on my main page which
will display a different image in a DIV for each tab pressed.

The problem is that I reproduce some working code I found on the web
but the image just blinks and disappear.

It's not in a form submitting anythings, so I didn't find a way to
use a "return false;" to keep the image displayed.

Any help on the following code?
(directories are correct: 'js' contains prototype.js 1.6.0.3
and all the rest, the pics are in the same "." directory)
The images are to be displayed in "<div id="tabbed_content"></div>"

Thanks for any tip.

−−−−−−−−−−−
<!DOCTYPE html PUBLIC "−//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1−transitional.dtd>
<html xmlns="http://www.w3.org/1999/xhtml>
<head>
<link rel="stylesheet" type="text/css" href="style.css"
media="screen" />
<script type="text/javascript" src="js/prototype.js"></script>
<title>MyTitle</title>

<style type="text/css">
#container {
width:450px;
color: white;
}
..tabul {
width:50px;
margin−right:10px;
padding:4px;
text−align:center;
float:left;

−> Ajax using prototype.js blinks image but doesn't display it... Help                            1
−> Ajax using prototype.js blinks image but doesn't display it... Help
cursor:pointer;
border:0px ;
border−bottom:0;
}
#tabbed_content {
height:350px;
clear:both;
border:0px ;
}
</style>

</head>
<body>
<div id="container">
<div class="tabul" id="tab1"><img src="img/tab_software_selected.jpg" width="68" height="17" /></div>
<div class="tabul" id="tab2"><img src="img/tab_ease_light.jpg" /></div>
<div class="tabul" id="tab3"><img src="img/tab_customize_light.gif" /></div>
<div id="tabbed_content"></div>
</div>


<script type="text/javascript">
function init () {
var tabs = document.getElementsByClassName('tabul');
for (var i = 0; i < tabs.length; i++) {
$(tabs[i].id).onclick = function () {
getTabData(this.id);
}
}
}

function getTabData(id) {
var url = 'process_image.php';
var pars = 'id=' + id ;
var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onComplete: showResponse} );
}

function showResponse (originalRequest) {
var newData = originalRequest.responseText;
$('tabbed_content').style.display = 'block';
$('tabbed_content').innerHTML = newData;
return false;
}
init();
</script>


</body>
</html>

Sincerely,

−> Ajax using prototype.js blinks image but doesn't display it... Help                                  2
−> Ajax using prototype.js blinks image but doesn't display it... Help
Steve JORDI

(Remove the K_I_L_LSPAM from my email address)
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
1197 Prangins Email: stevejordiK_I_L_LSPAM@xxxxxxxxxxx
Switzerland WWW: www.sjordi.com
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Volcanoes at www.sjordi.com/volcanoes
MovieDB at www.sjmoviedb.com
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
.




−> Ajax using prototype.js blinks image but doesn't display it... Help                   3
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?
Умеете ли вы читать этикетку товара?

More Related Content

What's hot

Game jump: frontend introduction #1
Game jump: frontend introduction #1Game jump: frontend introduction #1
Game jump: frontend introduction #1
Sebastian Pożoga
 
An in-depth look at jQuery UI
An in-depth look at jQuery UIAn in-depth look at jQuery UI
An in-depth look at jQuery UI
Paul Bakaus
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
velveeta_512
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
Karol Depka Pradzinski
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
Remy Sharp
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
Rob Bontekoe
 
JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)
jeresig
 
Sins Against Drupal 2
Sins Against Drupal 2Sins Against Drupal 2
Sins Against Drupal 2
Aaron Crosman
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)
jeresig
 
jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)
jeresig
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
Remy Sharp
 
jQuery in 15 minutes
jQuery in 15 minutesjQuery in 15 minutes
jQuery in 15 minutes
Simon Willison
 
Drupal sins 2016 10-06
Drupal sins 2016 10-06Drupal sins 2016 10-06
Drupal sins 2016 10-06
Aaron Crosman
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJS
Edi Santoso
 
1 eso-tema-2-el-relieve
1 eso-tema-2-el-relieve1 eso-tema-2-el-relieve
1 eso-tema-2-el-relieve
Neil R. Villasante Laura
 
Why You Shouldn't Write OO
Why You Shouldn't Write OO Why You Shouldn't Write OO
Why You Shouldn't Write OO
Yehuda Katz
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
Ext JS Introduction
Ext JS IntroductionExt JS Introduction
Ext JS Introduction
Anand Dayalan
 
javascript examples
javascript examplesjavascript examples
javascript examples
Egerton University
 
J querypractice
J querypracticeJ querypractice
J querypractice
Inbal Geffen
 

What's hot (20)

Game jump: frontend introduction #1
Game jump: frontend introduction #1Game jump: frontend introduction #1
Game jump: frontend introduction #1
 
An in-depth look at jQuery UI
An in-depth look at jQuery UIAn in-depth look at jQuery UI
An in-depth look at jQuery UI
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)
 
Sins Against Drupal 2
Sins Against Drupal 2Sins Against Drupal 2
Sins Against Drupal 2
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)
 
jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
jQuery in 15 minutes
jQuery in 15 minutesjQuery in 15 minutes
jQuery in 15 minutes
 
Drupal sins 2016 10-06
Drupal sins 2016 10-06Drupal sins 2016 10-06
Drupal sins 2016 10-06
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJS
 
1 eso-tema-2-el-relieve
1 eso-tema-2-el-relieve1 eso-tema-2-el-relieve
1 eso-tema-2-el-relieve
 
Why You Shouldn't Write OO
Why You Shouldn't Write OO Why You Shouldn't Write OO
Why You Shouldn't Write OO
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
Ext JS Introduction
Ext JS IntroductionExt JS Introduction
Ext JS Introduction
 
javascript examples
javascript examplesjavascript examples
javascript examples
 
J querypractice
J querypracticeJ querypractice
J querypractice
 

Viewers also liked

S I S T E M A S M A T E R I A L E S
S I S T E M A S  M A T E R I A L E SS I S T E M A S  M A T E R I A L E S
S I S T E M A S M A T E R I A L E S
quimica2007
 
Mullus Surmuletus Ii
Mullus Surmuletus IiMullus Surmuletus Ii
Mullus Surmuletus Iiprambla
 
Open House
Open HouseOpen House
Open House
cs210su7susan
 
TEBEO PLATJA D'ARO
TEBEO PLATJA D'AROTEBEO PLATJA D'ARO
TEBEO PLATJA D'ARORafa Mollà
 
Mike Newtown: Energy for Everyone: Intro to Renewables
Mike Newtown: Energy for Everyone: Intro to RenewablesMike Newtown: Energy for Everyone: Intro to Renewables
Mike Newtown: Energy for Everyone: Intro to Renewables
Ann Heidenreich
 
Whata Wonderful World G
Whata Wonderful World GWhata Wonderful World G
Whata Wonderful World G
hannygirl
 
Резюме_Татьяна Чихичина
Резюме_Татьяна ЧихичинаРезюме_Татьяна Чихичина
Резюме_Татьяна ЧихичинаTatyana Chikhichina
 
效果图
效果图效果图
效果图
liu sanchia enge
 
мобильные столы
мобильные столымобильные столы
мобильные столыVasyl Savchenko
 
شهاده البكالوريوس
شهاده البكالوريوسشهاده البكالوريوس
شهاده البكالوريوسWessam Elbarbary
 
衛生福利部苗栗醫院網路掛號系統
衛生福利部苗栗醫院網路掛號系統衛生福利部苗栗醫院網路掛號系統
衛生福利部苗栗醫院網路掛號系統Wan-Yu Chen
 
استقاله بنك الاسكندريه الكويت
استقاله بنك الاسكندريه الكويتاستقاله بنك الاسكندريه الكويت
استقاله بنك الاسكندريه الكويتWessam Elbarbary
 
טרום גיל המעבר
טרום גיל המעברטרום גיל המעבר
טרום גיל המעברYael Gati
 
เรื่องราวของเรา
เรื่องราวของเราเรื่องราวของเรา
เรื่องราวของเราSanti Sounsri
 
سيرة ذاتية عربي ماليزيا
سيرة ذاتية عربي  ماليزياسيرة ذاتية عربي  ماليزيا
سيرة ذاتية عربي ماليزياOla Al_Azab
 
شهادة خبرة الفرماوي
شهادة خبرة الفرماويشهادة خبرة الفرماوي
شهادة خبرة الفرماويMohamed Aboughaly
 

Viewers also liked (20)

S I S T E M A S M A T E R I A L E S
S I S T E M A S  M A T E R I A L E SS I S T E M A S  M A T E R I A L E S
S I S T E M A S M A T E R I A L E S
 
Mullus Surmuletus Ii
Mullus Surmuletus IiMullus Surmuletus Ii
Mullus Surmuletus Ii
 
Open House
Open HouseOpen House
Open House
 
TEBEO PLATJA D'ARO
TEBEO PLATJA D'AROTEBEO PLATJA D'ARO
TEBEO PLATJA D'ARO
 
Mike Newtown: Energy for Everyone: Intro to Renewables
Mike Newtown: Energy for Everyone: Intro to RenewablesMike Newtown: Energy for Everyone: Intro to Renewables
Mike Newtown: Energy for Everyone: Intro to Renewables
 
Whata Wonderful World G
Whata Wonderful World GWhata Wonderful World G
Whata Wonderful World G
 
רקע אחורי
רקע אחורירקע אחורי
רקע אחורי
 
Резюме_Татьяна Чихичина
Резюме_Татьяна ЧихичинаРезюме_Татьяна Чихичина
Резюме_Татьяна Чихичина
 
效果图
效果图效果图
效果图
 
札幌へようこそ
札幌へようこそ札幌へようこそ
札幌へようこそ
 
мобильные столы
мобильные столымобильные столы
мобильные столы
 
شهاده البكالوريوس
شهاده البكالوريوسشهاده البكالوريوس
شهاده البكالوريوس
 
衛生福利部苗栗醫院網路掛號系統
衛生福利部苗栗醫院網路掛號系統衛生福利部苗栗醫院網路掛號系統
衛生福利部苗栗醫院網路掛號系統
 
استقاله بنك الاسكندريه الكويت
استقاله بنك الاسكندريه الكويتاستقاله بنك الاسكندريه الكويت
استقاله بنك الاسكندريه الكويت
 
טרום גיל המעבר
טרום גיל המעברטרום גיל המעבר
טרום גיל המעבר
 
เรื่องราวของเรา
เรื่องราวของเราเรื่องราวของเรา
เรื่องราวของเรา
 
展后报道
展后报道展后报道
展后报道
 
سيرة ذاتية عربي ماليزيا
سيرة ذاتية عربي  ماليزياسيرة ذاتية عربي  ماليزيا
سيرة ذاتية عربي ماليزيا
 
شهادة خبرة الفرماوي
شهادة خبرة الفرماويشهادة خبرة الفرماوي
شهادة خبرة الفرماوي
 
خطابات شكر
خطابات شكرخطابات شكر
خطابات شكر
 

Similar to Умеете ли вы читать этикетку товара?

Artdm170 Week4 Java Script Effects
Artdm170 Week4 Java Script EffectsArtdm170 Week4 Java Script Effects
Artdm170 Week4 Java Script Effects
Gilbert Guerrero
 
The Thinking behind BEM
The Thinking behind BEMThe Thinking behind BEM
The Thinking behind BEM
Varya Stepanova
 
BreizhBeans - Web components
BreizhBeans - Web componentsBreizhBeans - Web components
BreizhBeans - Web components
Horacio Gonzalez
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007
Netvibes
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
Remy Sharp
 
How to Extend Axure's Animation Capability
How to Extend Axure's Animation CapabilityHow to Extend Axure's Animation Capability
How to Extend Axure's Animation Capability
Svetlin Denkov
 
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
RobotDeathSquad
 
JQUERY TUTORIALS
JQUERY TUTORIALSJQUERY TUTORIALS
JQUERY TUTORIALS
Moize Roxas
 
Bilder einbinden ist kein Thema, oder?
Bilder einbinden ist kein Thema, oder?Bilder einbinden ist kein Thema, oder?
Bilder einbinden ist kein Thema, oder?
Walter Ebert
 
Jquery plugin development
Jquery plugin developmentJquery plugin development
Jquery plugin development
Md. Ziaul Haq
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)
Mark Leusink
 
лукьянченко л.а. пос 10а
лукьянченко л.а. пос 10алукьянченко л.а. пос 10а
лукьянченко л.а. пос 10а
l10bov
 
Joomla v-15-squeezebox-in-your-joomla-website
Joomla v-15-squeezebox-in-your-joomla-websiteJoomla v-15-squeezebox-in-your-joomla-website
Joomla v-15-squeezebox-in-your-joomla-website
RBaggio2000
 
Drupal For Dummies
Drupal For DummiesDrupal For Dummies
Drupal For Dummies
Koen Delvaux
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the World
Jonathan Snook
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
Martin Hochel
 
BBUI
BBUIBBUI
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
Aiman Hud
 
GWT training session 2
GWT training session 2GWT training session 2
GWT training session 2
SNEHAL MASNE
 
Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)
Ontico
 

Similar to Умеете ли вы читать этикетку товара? (20)

Artdm170 Week4 Java Script Effects
Artdm170 Week4 Java Script EffectsArtdm170 Week4 Java Script Effects
Artdm170 Week4 Java Script Effects
 
The Thinking behind BEM
The Thinking behind BEMThe Thinking behind BEM
The Thinking behind BEM
 
BreizhBeans - Web components
BreizhBeans - Web componentsBreizhBeans - Web components
BreizhBeans - Web components
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
 
How to Extend Axure's Animation Capability
How to Extend Axure's Animation CapabilityHow to Extend Axure's Animation Capability
How to Extend Axure's Animation Capability
 
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
Dr. Strangelove or: How I learned to stop worrying and love HTML, CSS and Jav...
 
JQUERY TUTORIALS
JQUERY TUTORIALSJQUERY TUTORIALS
JQUERY TUTORIALS
 
Bilder einbinden ist kein Thema, oder?
Bilder einbinden ist kein Thema, oder?Bilder einbinden ist kein Thema, oder?
Bilder einbinden ist kein Thema, oder?
 
Jquery plugin development
Jquery plugin developmentJquery plugin development
Jquery plugin development
 
Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)Bootstrap and XPages (DanNotes 2013)
Bootstrap and XPages (DanNotes 2013)
 
лукьянченко л.а. пос 10а
лукьянченко л.а. пос 10алукьянченко л.а. пос 10а
лукьянченко л.а. пос 10а
 
Joomla v-15-squeezebox-in-your-joomla-website
Joomla v-15-squeezebox-in-your-joomla-websiteJoomla v-15-squeezebox-in-your-joomla-website
Joomla v-15-squeezebox-in-your-joomla-website
 
Drupal For Dummies
Drupal For DummiesDrupal For Dummies
Drupal For Dummies
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the World
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
 
BBUI
BBUIBBUI
BBUI
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
GWT training session 2
GWT training session 2GWT training session 2
GWT training session 2
 
Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)
 

More from Оксана Одариченко

плакаты егэ
плакаты егэплакаты егэ
плакаты егэ
Оксана Одариченко
 
день словаря 3 б класс учитель с.п.подоляк
день словаря 3 б класс учитель с.п.подолякдень словаря 3 б класс учитель с.п.подоляк
день словаря 3 б класс учитель с.п.подоляк
Оксана Одариченко
 
учим словарь со смешариками
учим словарь со смешарикамиучим словарь со смешариками
учим словарь со смешариками
Оксана Одариченко
 
словари
словарисловари
о подготовке к гиа 2017
о подготовке к гиа 2017о подготовке к гиа 2017
о подготовке к гиа 2017
Оксана Одариченко
 
дети из семей, находящихся в социально опасном
дети из семей, находящихся в социально опасномдети из семей, находящихся в социально опасном
дети из семей, находящихся в социально опасном
Оксана Одариченко
 
одаренные дети одариченко
одаренные дети одариченкоодаренные дети одариченко
одаренные дети одариченко
Оксана Одариченко
 
инклюзивное образование
инклюзивное образованиеинклюзивное образование
инклюзивное образование
Оксана Одариченко
 
детство как историческая категория
детство как историческая категориядетство как историческая категория
детство как историческая категория
Оксана Одариченко
 

More from Оксана Одариченко (20)

плакаты егэ
плакаты егэплакаты егэ
плакаты егэ
 
день словаря 3 б класс учитель с.п.подоляк
день словаря 3 б класс учитель с.п.подолякдень словаря 3 б класс учитель с.п.подоляк
день словаря 3 б класс учитель с.п.подоляк
 
учим словарь со смешариками
учим словарь со смешарикамиучим словарь со смешариками
учим словарь со смешариками
 
словари
словарисловари
словари
 
о подготовке к гиа 2017
о подготовке к гиа 2017о подготовке к гиа 2017
о подготовке к гиа 2017
 
дети из семей, находящихся в социально опасном
дети из семей, находящихся в социально опасномдети из семей, находящихся в социально опасном
дети из семей, находящихся в социально опасном
 
одаренные дети одариченко
одаренные дети одариченкоодаренные дети одариченко
одаренные дети одариченко
 
инклюзивное образование
инклюзивное образованиеинклюзивное образование
инклюзивное образование
 
детство как историческая категория
детство как историческая категориядетство как историческая категория
детство как историческая категория
 
8 марта
8 марта8 марта
8 марта
 
NOU
NOUNOU
NOU
 
O proekte
O proekteO proekte
O proekte
 
Narkotiki
NarkotikiNarkotiki
Narkotiki
 
Proizvodstvo reclamyi
Proizvodstvo reclamyiProizvodstvo reclamyi
Proizvodstvo reclamyi
 
Otkuda beretsya reklama
Otkuda beretsya reklamaOtkuda beretsya reklama
Otkuda beretsya reklama
 
Vidyi reklamyi
Vidyi reklamyiVidyi reklamyi
Vidyi reklamyi
 
Sozialnaya reklama
Sozialnaya reklamaSozialnaya reklama
Sozialnaya reklama
 
Resyrsu proekta
Resyrsu proektaResyrsu proekta
Resyrsu proekta
 
Avtorskoe pravo
Avtorskoe pravoAvtorskoe pravo
Avtorskoe pravo
 
Rukovoditelyou proektov
Rukovoditelyou proektovRukovoditelyou proektov
Rukovoditelyou proektov
 

Умеете ли вы читать этикетку товара?

  • 1. −> Ajax using prototype.js blinks image but doesn't display it... Help −> Ajax using prototype.js blinks image but doesn't display it... Help Source: http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.javascript/2010−01/msg01335.html • From: Steve JORDI <stevejordiK__I_L_LSP_AM@xxxxxxxxxxx> • Date: Thu, 21 Jan 2010 15:04:46 +0100 Hi, I'm trying to implement a tabbed container on my main page which will display a different image in a DIV for each tab pressed. The problem is that I reproduce some working code I found on the web but the image just blinks and disappear. It's not in a form submitting anythings, so I didn't find a way to use a "return false;" to keep the image displayed. Any help on the following code? (directories are correct: 'js' contains prototype.js 1.6.0.3 and all the rest, the pics are in the same "." directory) The images are to be displayed in "<div id="tabbed_content"></div>" Thanks for any tip. −−−−−−−−−−− <!DOCTYPE html PUBLIC "−//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1−transitional.dtd> <html xmlns="http://www.w3.org/1999/xhtml> <head> <link rel="stylesheet" type="text/css" href="style.css" media="screen" /> <script type="text/javascript" src="js/prototype.js"></script> <title>MyTitle</title> <style type="text/css"> #container { width:450px; color: white; } ..tabul { width:50px; margin−right:10px; padding:4px; text−align:center; float:left; −> Ajax using prototype.js blinks image but doesn't display it... Help 1
  • 2. −> Ajax using prototype.js blinks image but doesn't display it... Help cursor:pointer; border:0px ; border−bottom:0; } #tabbed_content { height:350px; clear:both; border:0px ; } </style> </head> <body> <div id="container"> <div class="tabul" id="tab1"><img src="img/tab_software_selected.jpg" width="68" height="17" /></div> <div class="tabul" id="tab2"><img src="img/tab_ease_light.jpg" /></div> <div class="tabul" id="tab3"><img src="img/tab_customize_light.gif" /></div> <div id="tabbed_content"></div> </div> <script type="text/javascript"> function init () { var tabs = document.getElementsByClassName('tabul'); for (var i = 0; i < tabs.length; i++) { $(tabs[i].id).onclick = function () { getTabData(this.id); } } } function getTabData(id) { var url = 'process_image.php'; var pars = 'id=' + id ; var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onComplete: showResponse} ); } function showResponse (originalRequest) { var newData = originalRequest.responseText; $('tabbed_content').style.display = 'block'; $('tabbed_content').innerHTML = newData; return false; } init(); </script> </body> </html> Sincerely, −> Ajax using prototype.js blinks image but doesn't display it... Help 2
  • 3. −> Ajax using prototype.js blinks image but doesn't display it... Help Steve JORDI (Remove the K_I_L_LSPAM from my email address) −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− 1197 Prangins Email: stevejordiK_I_L_LSPAM@xxxxxxxxxxx Switzerland WWW: www.sjordi.com −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− Volcanoes at www.sjordi.com/volcanoes MovieDB at www.sjmoviedb.com −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− . −> Ajax using prototype.js blinks image but doesn't display it... Help 3