1
SMEDrieben
How to refer to jquery.js ?
  • 2013/3/17 10:10

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


I installed a slideshow in my theme that works with jquery. The file jquery.js, located in xoops_lib/Frameworks/jquery/, is OK. How can I refer to this file ?

I added a line to the head section of theme.html:

<script type="text/javascript" src="XOOPS_PATH/Framworks/jquery/jquery.js">script>


This doesn't work. I don't know how to get it working. Finally, I copied the jquery.js to the mytheme folder and changed the script line in theme.html:

<script type="text/javascript" src="<{$xoops_imageurl}>/jquery.js">script>


This works fine ! However, the jquery.js present at two locations at my site. How can I refer to the file in the xoops_lib/Frameworks/jquery folder ? Can I use a smarty constant for referring to xoops_lib ?

Thanks,

SMEDrieben

2
Mamba
Re: How to refer to jquery.js ?
  • 2013/3/17 10:25

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


I hope, this advice is still valid
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

3
SMEDrieben
Re: How to refer to jquery.js ?
  • 2013/3/17 11:21

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


Unfortunately, it does not work in my case. Perhaps, I make a mistake. Should I put the following:

<{php}>
/** add JQuery and JQuery UI */
global $xoTheme
$xoTheme->addScript("browse.php?Frameworks/jquery/jquery.js");
$this->assign('xoops_module_header'$xoTheme->renderMetas(nulltrue)); 
<{/
php}>


within the head section of theme.html of somewhere else ? Furthermore, my xoops_lib is outside the public domain. Does it have any influence ?

Thanks !

SMEDrieben


4
Mamba
Re: How to refer to jquery.js ?
  • 2013/3/17 12:01

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Seems OK to me, but I am not a theme specialist Did you include after your code above, the:
<{$xoops_module_header}>
The code that I have from the book "Design for XOOPS" (highly recommended), is as follow:
<{php}> 
/** add JQuery and JQuery UI */ 
global $xoTheme;  
$xoTheme->addScript("browse.php?Frameworks/jquery/jquery.js"); 
$header = empty($GLOBALS['xoopsOptions']['xoops_module_header']) ? 
$this->get_template_vars('xoops_module_header') : 
(
$GLOBALS['xoopsOptions']['xoops_module_header']);
$this->assign('xoops_module_header'$xoTheme->renderMetas(nulltrue) . $header);  
<{/
php}>
<{
$xoops_module_header}>
Quote:
Furthermore, my xoops_lib is outside the public domain. Does it have any influence ?
No, it shouldn't.
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

5
SMEDrieben
Re: How to refer to jquery.js ?
  • 2013/3/17 12:46

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


Thanks ! It works fine now.

SMEDrieben

6
SMEDrieben
Re: How to refer to jquery.js ?
  • 2013/3/18 11:49

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


One problem I didn't notice yesterday: system messages (light blue background) that appear at the top of the page after logging in or out, are now shown twice ! Two identical messages (thanks for logging in etc, together with a "close all" message).

How can I solve this ?

SMEDrieben

7
SMEDrieben
Re: How to refer to jquery.js ?
  • 2013/5/10 13:37

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


A few weeks after my last post in this thread, I've solved the doubling of system messages by using the script from the suico theme. I used the script in theme.html:

<{php}>  
    
/** add JQuery and JQuery UI */  
    
global $xoTheme;   
    
$xoTheme->addScript("browse.php?Frameworks/jquery/jquery.js");  
    
$header = empty($GLOBALS['xoopsOptions']['xoops_module_header']) ?  
    
$this->get_template_vars('xoops_module_header') :  
    (
$GLOBALS['xoopsOptions']['xoops_module_header']); 
    
$this->assign('xoops_module_header'$xoTheme->renderMetas(nulltrue) . $header);   
<{/
php}>


This script results in the doubling of system messages (2 times "Thanks for logging in" etc.). I replaced this script with the script of the suico theme:

<{php}>
/** add JQuery and JQuery UI */
    
global $xoTheme
        
$xoTheme->addScript("browse.php?Frameworks/jquery/jquery.js");
        
$xoTheme->addScript("browse.php?Frameworks/jquery/plugins/jquery.ui.js");
        
$this->assign('xoops_module_header'$xoTheme->renderMetas(nulltrue)); 
<{/
php}>


Now the doubling has disappeared !

SMEDrieben

Login

Who's Online

449 user(s) are online (360 user(s) are browsing Support Forums)


Members: 0


Guests: 449


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits