Search Results

Search found 45 results on 2 pages for 'fbjs'.

Page 1/2 | 1 2  | Next Page >

  • problem with editing fbjs string on the fly (fb_protected=true)

    - by Ahsan
    Hi there, I am facing this problem : I have a fbjs string which I use forDialog().showChoice() I populate part of the fbjs string from data I get through mysql. Now I update the data in fb:dialog and want this update to be reflected the next time I update/call the dialog box. However, seemingly, my fbjs string is wrap protected : <span class="fb_protected_wrapper" fb_protected="true"></span> Is there a way out ? Can anyone please help? Thanks. - ahsan

    Read the article

  • facebook flash - Variable FBJS is not defined

    - by Murvinlai
    I have a simple Flash just put in for an facebook app. it is so simple that only one frame and one text box. that's all. I have this <fb:fbjs-bridge/> <fb:swf swfsrc="http://path/test2.swf" width="100" height="100" /> <script> <!-- --> </script> and I have no error to show the flash in Firefox & Chrome. But in IE, I get this: VerifyError: Error #1033: Cpool entry 36 is wrong type. ReferenceError: Error #1065: Variable FBJS is not defined. What happen? what does it mean? :)

    Read the article

  • converted javascript to fbjs - tabs still not working

    - by JohnMerlino
    Hey all, I tried my best to convert javascript to fbjs according to this page: http://wiki.developers.facebook.com/index.php/FBJS. Yet my tabs are still not working properly. Does anyone have any suggestions how to fix this so I can click through the tabs and display and hide content accordingly: <script type="text/javascript"><!-- var tabLinks = []; var contentDivs = []; function init() { var tabListItems = document.getElementById('tabs').getChildNodes(); for ( var i = 0; i < tabListItems.length; i++ ) { if ( tabListItems[i].getNodeName("LI") ) { var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' ); var id = getHash( tabLink.getAttribute('href') ); tabLinks[id] = tabLink; contentDivs[id] = document.getElementById( id ); } } var i = 0; for ( var id in tabLinks ) { tabLinks[id].addEventListener(onclick, showTab) tabLinks[id].addEventListener(onfocus, function() { this.blur() }; if ( i == 0 ) tabLinks[id].setClassName('selected'); i++;) } var i = 0; for ( var id in contentDivs ) { if ( i != 0 ) contentDivs[id].setClassName('tabContent hide'); i++; } } function showTab() { var selectedId = getHash( this.getAttribute('href') ); for ( var id in contentDivs ) { if ( id == selectedId ) { tabLinks[id].setClassName('selected'); contentDivs[id].setClassName('tabContent'); } else { tabLinks[id].setClassName(''); contentDivs[id].setClassName('tabContent hide'); } } return false; } function getFirstChildWithTagName( element, tagName ) { for ( var i = 0; i < element.getChildNodes().length; i++ ) { if ( element.getChildNodes[i].getNodeName(tagName) ) return element.getChildNodes[i]; } } function getHash( url ) { var hashPos = url.getLastIndexOf ( '#' ); return url.getSubString( hashPos + 1 ); } init(); --></script> Thanks for any response.

    Read the article

  • document.getElementById not working at FBJS

    - by Willy
    I'm developing apps at Facebook using FBML and FBJS. When I tried to use document.getElementById to read tag, it did not reply the correct value. Can we really use this command on FBML to get data? Here is detail of my code : <input type="hidden" value="123" id="number"/> <a href="#" onclick="new Dialog().showMessage('Dialog', document.getElementById('number').value);return false"/>

    Read the article

  • Publish to Current user's wall using FBJS in FBML application

    - by Damodaran
    Hi I need to publish some message to the current user's wall using FBJS in FBML application. When I use window.fbAsyncInit = function() { FB.init({appId: 'MY_APP_ID', status: true, cookie: true, xfbml: false}); }; i am getting an error :- FB is not defined. and window is not defined. For publishing i am using this code function graphStreamPublish(){ var body = document.getElementById("txtTextToPublish").value; FB.api('/me/feed', 'post', { message: body }, function(response) { if (!response || response.error) { // alert('Error occured'); } else { // alert('Post ID: ' + response.id); } }); } (I cannot use alert in facebook..) Thanks in advance..

    Read the article

  • fbjs ajax to load content

    - by fusion
    i tried one of the examples here to load the content in the div, but apart from displaying the image, it doesn't show anything. can anyone please point out where i'm going wrong? ajax1.js: function General_Refresh(url,div){ //Showing the load image (pay attention to /> of <img document.getElementById(div).setInnerXHTML('<span id="caric"><center><img src="http://website.name/images/ajax-loader.gif" /></center></span>'); var ajax = new Ajax(); ajax.responseType = Ajax.FBML; ajax.ondone = function(data) { //Hide the loading image document.getElementById('caric').setStyle('display','none'); document.getElementById(div).setInnerFBML(data); } //If there are errors re-try ajax.onerror = function() { General_Refresh(url,div); } ajax.post(url); } quote.html: <script src="http://website.name/scripts/ajax1.js" type="text/javascript"></script> <script type="text/javascript"> <!-- General_Refresh("http://website.name/quote.php","quote"); //--> </script> <div id="wrapper"> <div id="quote"><strong>this</strong></div> </div></div>

    Read the article

  • pagination in fbjs/ajax

    - by fusion
    i've a search form in which i'm trying to implement pagination - getting the data through ajax. everything works out fine initially, except when i go to the next page or any of the links on the pagination. it gives me a page not found error. can anyone please point out what is wrong with my code? search.html <div class="search_wrapper"> <input type="text" name="query" id="query" class="txt_search" onkeyup="submitPage('http://website/name/search.php', 'txtHint', '1');" /> <input type="button" name="button" class="button_search" onclick="submitPage('http://website/name/search.php', 'txtHint', '1');" /> <p> <div id="txtHint"></div> </p> </div> search ajax.js: function submitPage(url, target_id, page) { // Retrieve element handles, and populate request parameters. var target = document.getElementById(target_id); if(typeof page == 'undefined') { page = 1; } // Set up an AJAX object. Typically, an FBML response is desired. document.getElementById(target_id).setInnerXHTML('<span id="caric"><center><img src="http://website/name/images/ajax-loader.gif" /></center></span>'); var ajax = new Ajax(); ajax.responseType = Ajax.FBML; ajax.requireLogin = true; ajax.ondone = function(data) { // When the FBML response is returned, populate the data into the target element. document.getElementById('caric').setStyle('display','none'); if (target) target.setInnerFBML(data); } ajax.onerror = function() { var msgdialog = new Dialog(); msgdialog.showMessage('Error', 'An error has occurred while trying to load.'); return false; } var params = { 'query' : document.getElementById('query').getValue() }; ajax.post(url, params, page); } search.php: $search_result = ""; if (isset($_POST["query"])) $search_result = trim($_POST["query"]); if(isset($_GET['page'])) $page = $_GET['page']; else $page = 1; ..... $self = $_SERVER['PHP_SELF']; $limit = 2; //Number of results per page $numpages=ceil($totalrows/$limit); $query = $query." ORDER BY idQuotes LIMIT " . ($page-1)*$limit . ",$limit"; $result = mysql_query($query, $conn) or die('Error:' .mysql_error()); ?> <div class="search_caption">Search Results</div> <div class="search_div"> <table> . . .display results </table> </div> <hr> <div class="searchmain"> <?php //Create and print the Navigation bar $nav=""; $next = $page+1; $prev = $page-1; if($page > 1) { $nav .= "<a onclick=\"submitPage('','','$prev'); return false;\" href=\"$self?page=" . $prev . "&q=" .urlencode($search_result) . "\">< Prev</a>"; $first = "<a onclick=\"submitPage('','','1'); return false;\" href=\"$self?page=1&q=" .urlencode($search_result) . "\"> << </a>" ; } else { $nav .= "&nbsp;"; $first = "&nbsp;"; } for($i = 1 ; $i <= $numpages ; $i++) { if($i == $page) { $nav .= "<span class=\"no_link\">$i</span>"; }else{ $nav .= "<a onclick=\"submitPage('','',$i); return false;\" href=\"$self?page=" . $i . "&q=" .urlencode($search_result) . "\">$i</a>"; } } if($page < $numpages) { $nav .= "<a onclick=\"submitPage('','','$next'); return false;\" href=\"$self?page=" . $next . "&q=" .urlencode($search_result) . "\">Next ></a>"; $last = "<a onclick=\"submitPage('','','$numpages'); return false;\" href=\"$self?page=$numpages&q=" .urlencode($search_result) . "\"> >> </a>"; } else { $nav .= "&nbsp;"; $last = "&nbsp;"; } echo $first . $nav . $last; ?> </div> this is the link which displays on the next page: http://apps.facebook.com/website-folder/search.php?page=2&q=good&_fb_fromhash=[some obscure number]

    Read the article

  • facebook FBML,FBJS

    - by Rohit
    I want to use FBML as a canvas and would like to display a rich text editor like fckeditor or other. Can anybody out there help me out on this? e.g. to format text mainly bold,italics. Is it possible? how? I'm eager to learn more from the responder.

    Read the article

  • How to use FBJS to get the language preference of the user?

    - by ed.talmadge
    I'm modifying an existing FaceBook application. The FaceBook application is generated by another application, so I don't have much control over it. I can only add html/javascript. My goal is to use FBJS to detect the current language setting of the user and display a different message depending on their language. For example, if the user has their language setting set to Spanish, then I would like to show a message in Spanish on my FaceBook application. How can I do this?

    Read the article

  • Why is FBJS dropping my 'onclick' attribute from this input element?

    - by Chris Barnhill
    When I include an 'onClick' attribute in setInnerXTHML() like this: var innerHtml = '<span>Build Track: Select a city where track building should begin'+ '<div id="action-end">'+ '<form>'+ '<input type="button" value="End Track Building" id="next-phase" onClick="moveTrainAuto();" />'+ '</form>'+ '</div></span>'; actionPrompt.setInnerXHTML(innerHtml); var btn = document.getElementById('next-phase'); btn.addEventListener('click', 'moveTrainAuto'); The 'onClick' gets dropped. I know this from inspecting the element with Firebug. This is what it reveals: <input id="app148184604666_next-phase" type="button" value="End Track Building"/> Here is the function called for onClick: function moveTrainAuto(evt) { debugger; ajax = new Ajax(); ajax.responseType = Ajax.JSON; ajax.ondone = function(data) { debugger; if(data.code == 'UNLOAD_CARGO') { unloadCargo(); } else if (data.code == 'MOVE_TRAIN_AUTO') { moveTrainAuto(); } else if (data.code == 'TURN_END') { turnEnd(); } else { /* handle error */ } } ajax.post(baseURL + '/turn/move-trains-auto'); } As you can see, I've tried both 'onClick' and 'addEventListener'. Neither works. Any ideas?

    Read the article

  • FBJS in facebook

    - by gacon
    I want to use javascript in my facebook application, but I don't know how to start with FBJS to use it. Someone help me please! just something like <div onclick="greeting();">click me</div> <script> function greeting(){ alert("hello world"); } </script>

    Read the article

  • Javascript not showing up on Facebook Application's Profile Tab

    - by prateekdayal
    Hi, This may sound very noobish but I have tried to read the forum posts and docs on javascript behavior on Facebook's profile tabs. I understand that profile tabs don't support referencing external javascript but even my inline tags are not showing up on profile pages. In fact I am trying the fbjs-swf bridge and the code needed to instantiate the swf does not show up on the page <fb:fbjs_bridge/> <div id="swfContainer"></div> <script> var swf = document.createElement('fb:swf'); swf.setId('my_swf_id'); swf.setWidth('630'); swf.setHeight('520'); swf.setSWFSrc('http://www.muziboo.com/swf/player4-2.swf'); document.getElementById('swfContainer').appendChild(swf); document.getElementById('my_swf_id').callSWF('asMethod', 'one', 'two'); </script> I see a swf embedded (the one for the fbjs bridge) but I don't see any script tag containing the above javascript code. What am I missing? I can see the javascript code on canvas page though Thanks

    Read the article

  • form target iframe not working in IE7- in facebook fan tab

    - by greatcaesarsghost
    This issue is similar to the one discussed in this thread, only mine is in a Facebook fan page tab (FBML/FBJS). The fix described in the referenced question works fine outside of Facebook, but for whatever reason I can't get it to work in the posted FBJS. Here's a stripped down version of what I'm trying to do: <script type="text/javascript"> function doit() { document.getElementById('msg').setInnerXHTML('<iframe id="testframe" name="testframe" frameborder="0" />'); } </script> <div id="msg"></div> <form action="http://somesite.com/whatever.php" method="post" id="testform" name="testform" target="testframe"> <input type="text" id="txt1" name="txt1" /> <input type="submit" id="btn" name="btn" value="test" onclick="doit();" /> </form> -- This behaves as you'd expect in all browsers, except IE <= 7, where it opens a new window. IE's dev tool shows the iframe as having a 'submitName' attribute, but no 'name' attribute. Even by manually setting the name (document.getElementbyId('testframe').setName('testframe') fails to work the way it would outside of Facebook. Has anyone run into this same issue, and if so, is there any way around it? Thank you.

    Read the article

  • facebook quote application error

    - by fusion
    how do i code a facebook quote application taking its data from php/mysql page generating quotes randomely? i've already developed one, but it's using jquery which fbml doesn't support and since i'd like the profile tab i'd rather go for fbml instead of iframe. anyone have any ideas on how to do this without jquery or using fbjs? thanks!

    Read the article

  • Post-Render Fbml (Ajax Callback)

    - by fabian
    Hi there, i am doing a simple ajax call with FBJS. The server returns a fbml string which i render in one of my DIVs. The Problem: FB doesnt render the prefix for attributes like style, onclick etc. I have seen a function for some kind of post-rendering somewhere. But i cant remember Thanks for helping.

    Read the article

  • how to turn off fb_noscript?

    - by Murvinlai
    in my facebook FBML app, I have the flash connecting to the js (in FBJS) . I have set up the stuffs like that and working. However, sometimes, the bridge connection fails and I see thatin the URL, facebook attach the fb_noscript=1 parameter there. e.g. apps.facebook.com/myapp/?fb_noscript=1 when I remove it, and reload the apps, it is all good. I just don't know what I get the fb_noscript thing. and how to get rid of it.

    Read the article

  • how to turn off fb_noscript?

    - by Murvinlai
    in my facebook FBML app, I have the flash connecting to the js (in FBJS) . I have set up the stuffs like that and working. However, sometimes, the bridge connection fails and I see thatin the URL, facebook attach the fb_noscript=1 parameter there. e.g. apps.facebook.com/myapp/?fb_noscript=1 when I remove it, and reload the apps, it is all good. I just don't know what I get the fb_noscript thing. and how to get rid of it.

    Read the article

  • Facebook tab application scripting

    - by zznq
    I have a web application that I am trying to port to Facebook. The app uses a few external javascript files. So initially I wanted to create an iframe Facebook application. However, it turns out that you cannot use iframes when creating a tab application(which is a requirement). By tab application I mean placing your app on the profile page next to the wall, info, photos, ect. tabs. Does any one know of a good tool to help convert my javascript to the FBJS scripting? Or better yet does anyone have a work around so that I can include my own javascript in this tabbed application? Thanks for the help.

    Read the article

  • validation in javascript - remove the error msg on focus

    - by fusion
    i'm not very well-versed with javascript, so please bear with me. i've a form in which i validate the controls with javascript. the error is displayed when the fields are empty via a div, but when i focus and type something in the textbox, the div should go away. but the error div doesn't and even if i type something valid, it still displays the div. i'd like to know where am i going wrong with this script: <script type="text/javascript"> var err = document.getElementById("errmsg"); function checkInput(inPut) { if (inPut.getValue() == "") { err.setStyle('display', 'block'); err.setTextValue("Field cannot be empty!"); inPut.focus(); return false; } else { return true; } } function checkTextBox(textBox) { if (textBox.getValue() == "") { err.setStyle('display', 'block'); err.setTextValue("Field cannot be empty!"); textBox.focus(); return false; } else if (!checkValidity(textBox.getValue())) { err.setStyle('display', 'block'); err.setTextValue("Please enter a valid email address!"); textBox.focus(); return false; } else { return true; } } . . . <div id="errmsg" class="invalid" style="display:none;"></div> <br /> . . . <input type="text" tabindex="1" name="name" id="name" class="input_contact" onblur="checkInput(this);"/> <br /> . . . <input type="text" tabindex="2" name="email" id="email" class="input_contact" onblur="checkTextBox(this);"/> <br /> it's a form in facebook app but while the fbjs works, i assume there's a problem with my basic javascript.

    Read the article

  • How to Prompt user with permission dialog in iframe application

    - by ibrahimkhan
    Hi, I am using Facebook.showPermissionDialog("read_stream,publish_stream, offline_access, email") to show permission dialog. Its working in FBML mode but the problem is in IFRAME mode. The below code also works fine in FBML mode but not in Iframe mode. fb:prompt-permission perms="read_stream,publish_stream, offline_access, email"Allow Access? Please help me regarding this.. I need to display Prompt permission dialog in IFRAME mode Thanks in advance, Ibrahim.

    Read the article

1 2  | Next Page >