Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello
1-i have a page that include a js file call 'Clock.js'
JavaScript
<script type="text/javascript" src="js/Clock.js"></script>

this script has a func call 'showdate()' ;
2-in my page there is another func that has a Code like this :
JavaScript
image_path :'',slides : [ {image:'picture/1.jpg', title:'String',thumb:''}

i pointed it by (**) in Code below:
--------------------------------------------------------------------------------
JavaScript
<script type = "text/javascript">
    jQuery(function () {
        jQuery.supersized({
            //Functionality
            progress_bar : 1, // Timer for each slide
            mouse_scrub : 0,
            slide_links : 'blank', // Individual links for each slide (Options: false, 'number', 'name', 'blank')
            start_slide :  0 , //Start slide (0 is random)
            slide_interval :  4000 ,
            transition :  1 ,
            transition_speed :  1000 ,
            keyboard_nav :  true ,
            performance :  2 ,
            slide_counter : 0,
            slide_captions : 0,
        **  image_path :'',slides : [ {image:'picture/1.jpg', title:"پنج شنبه - 07 فروردین 1393",thumb:''}
            ,{image:'picture/2.jpg',title:'Thursday - 27 March 2014',thumb:''}
            ,{image:'picture/3.jpg',title:'الخميس - 26 جمادی الأول 1435',thumb:''}]});
            });
    </script >


--------------------------------------------------------------------------------
3-i want to call showdate() instead of String into that Code .
it will be like this:
JavaScript
image_path :'',slides : [ {image:'picture/1.jpg', title: showdate(),thumb:''}

ok
i test it like it but it does not work :
image_path :'',slides : [ {image:'picture/1.jpg', title:<Script> showdate()</Script>,thumb:''}
how Should i do that.
pls help
Posted
Updated 27-Mar-14 3:50am
v2
Comments
Snesh Prajapati 27-Mar-14 9:42am    
Please use code block for representing the code. It would be easy to find out the problem.
mahmoodof 27-Mar-14 9:56am    
hello
i used code block .
what should i do in Code?
Trajan McGill 27-Mar-14 10:18am    
I'm not sure what you are trying to do with this:
image_path :'',slides : [ {image:'picture/1.jpg', title:<Script> showdate()</Script>,thumb:''}
those script tags are unnecessary, you're already in a script block. simply setting the title value to showdate() should work. Are you sure showdate() is working and returning a string successfully? You say it "does not work," but you don't say how it is failing.
mahmoodof 27-Mar-14 10:40am    
hello again
this is Clock Code Script: Does it return String?
<pre>week= new Array("يكشنبه","دوشنبه","سه شنبه","چهارشنبه","پنج شنبه","جمعه","شنبه")
months = new Array("فروردين","ارديبهشت","خرداد","تير","مرداد","شهريور","مهر","آبان","آذر","دي","بهمن","اسفند");
a = new Date();
d= a.getDay();
day= a.getDate();
month = a.getMonth()+1;
year= a.getYear();
year = (year== 0)?2000:year;
(year<1000)? (year += 1900):true;
year -= ( (month < 3) || ((month == 3) && (day < 21)) )? 622:621;
switch (month) {
case 1: (day<21)? (month=10, day+=10):(month=11, day-=20); break;
case 2: (day<20)? (month=11, day+=11):(month=12, day-=19); break;
case 3: (day<21)? (month=12, day+=9):(month=1, day-=20); break;
case 4: (day<21)? (month=1, day+=11):(month=2, day-=20); break;
case 5:
case 6: (day<22)? (month-=3, day+=10):(month-=2, day-=21); break;
case 7:
case 8:
case 9: (day<23)? (month-=3, day+=9):(month-=2, day-=22); break;
case 10:(day<23)? (month=7, day+=8):(month=8, day-=22); break;
case 11:
case 12:(day<22)? (month-=3, day+=9):(month-=2, day-=21); break;
default: break;
}
document.write(" "+week[d]+" "+day+" "+months[month-1]+" "+ year);</pre>
if Yes - when i write Code like this .
<pre>image_path :'',slides : [ {image:'picture/1.jpg', title:<Script> showdate()</Script>,thumb:''}</pre>
it Does not Work.it has no bug or Error.My Editor is HtmlEditor 11.0
thank you for your answer.
mahmoodof 27-Mar-14 10:42am    
my problem is right this part of Code:
title:<Script> showdate()</Script>
it Does not Accept First <Script> tag.

1 solution

 
Share this answer
 
v2
Comments
mahmoodof 27-Mar-14 10:53am    
thank you.
Snesh Prajapati 27-Mar-14 13:26pm    
Welcome !!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900