Thread:Extension talk:SemanticTitle/Missing function for calling from other extensions/reply (4)

Hi Cindy

I'm sorry to say I am still struggling a bit here, totally due to my ignorance. I hope you may be able to help and give me some pointers? Firstly I try to access the API from javascript using the following statement:

var title = $.post(wgServer + wgScriptPath + "/api.php?action=getSemanticTitle&titles=Item:1&format=jsonfm") ;

This returns [object Object] for pages with semantic titles. For pages without semantic titles it returns the page name correctly.

Secondly, I tried using the following from within a PHP extension:

$title = SemanticTitle::getText( Title $name );

This causes the script to hang. I also tried without the word Title in the parameters passed to the function but the same happens.

I've spent a few hours trying variants on both techniques but don't seem to be getting very far. So I do hope you may be able to guide me a little?

Many thanks Duncan