Languages

Menu
Sites
Language
Getting error when navigating to another page

Hi,

I'm developing web app. I have a collapsible listview with multiple items. When i click on the <li> its not navigate to another page(#chapter) and i'm using the ajax function to load the corresponding data on "#chapter". Getting error as 

Error: Syntax error, unrecognized expression: #chapter?book=Lev&num=1

getting this error in library jquery.js

code:

<li data-id="test-id"><a href="#chapter?book='+ x.substring(1) +'&num=1">'+ books[x].bname +'</a></li>

 

Thanks in Advance.

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

5 Replies
Alexander AVSukhov

Hello,

I think your problem is in the incorrect use of single and double quotes

Marco Buettner

Try this

	<li data-id="test-id"><a href="#chapter?book="+ x.substring(1) +"&num=1">'+ books[x].bname +'</a></li>
Lakshmi Prathyusha

Hi Marco Buettner

its not working.

Now getting error as

Error: Syntax error, unrecognized expression: #chapter?book=

and my ajax function to laod the data 

function showChapter(url, options) {
    
    // Get book by its short-name
    	var book = books[ '_' + params['book'] ];
		if( !book ) {
			alert('Book not found!');
			return
		}
        
// book xml was not loaded ?
    	if( book['xml']==undefined || !book['xml'] ){
			// call loadBook first
			loadBook( params['book'], url, options);
			return
		}
}

// load book xml by its short name
    function loadBook(bsname, url, options) {
		
		// load book xml file and call showChapter again
		$.ajax({
			url:'books/'+bsname+'.xml'
			,datatype:'xml'
			,success:function(xml){
				$.mobile.hidePageLoadingMsg();
				// set xml property of the book item
				var book = books[ '_' + bsname ];
				book['xml'] = xml;

				// call showChapter 
				showChapter( url, options );
			}
		});
	}

I placed the books folder in widgets folder and my code.js file is in the same location. But i'm getting the alert as "Book not found". Is the path of the books is correct .

 

Thanks & Regards

Marco Buettner

You can try to use

/opt/apps/<AppId>/res/books/

as path of your book locations.

 

Lakshmi Prathyusha

Hi Marco Buettner

I used like this

 url:'/opt/apps/vhwpyf0pfl.App/res/books/'+bsname+'.xml'

 in ajax function but not working.

where i can find the 

/opt/apps/<AppId>/res/books/

I'm getting the error as

Error: Syntax error, unrecognized expression: #chapter?book=Exod&num=1

This error getting in framework library  tizen-web-ui-fw/latest/js/jquery.js

If i used without framework librarys its working fine but its not working when i used framework librarys.