- Screen name: n0vice.1
n0vice.1's Profile
20 Posts
37 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- I'm posting this here because PhotoSwipe is kind of like a plugin, while advertising itself as another javascript library.
I have a test page that I’m trying to develop on our new mobile site (which is within a mobile host). I previously had this same code on a test page in our production site and it worked fine (the code can be found here: http://pastebin.com/VkiKPHY2 ). The images I’m trying to display are also stored on our production site host.
I’m not sure what the problem is with things not working, in the mobile host. In Firefox there are no apparent javascript errors when on the test page within our production site, but when I go to the test page in our mobile host site I am getting javascript errors. Like this:
d is not a function
https://www.stchas.edu/global/js-widgets/photoswipe/code.photoswipe.jquery.3.0.5.min.js$(‘#Gallery a’).photoSwipe is not a function
https://www.stchas.edu/home/test/news-detail.html?mainFrame=true&livePage=0&language=1&host_id=7e5bc65b-cc7f-461b-9b3a-670f47094dbd& id=e3faead9-999a-4e46-8fb7-2673e4f76965So I’m guessing that there’s some kind of javascript or JQuery conflict in our mobile site’s environment that isn’t there in our production site, because it looks like Photoswipe is either not being found or not being successfully accessed to be recognized by Firefox as a legitimate JQuery function based on the error messages above.
I’m currently to using PhotoSwipe version 3.0.5 along with jquery-1.7.1.min.js. All of the CSS document references are in the templates used by both pages. I'm also working within a dotcms content management system environment as well which accounts for the "${esc.d}" and "${esc.h}" character strings that appear the code, to distinguish them from velocity code where the dollar-sign always starts a variable name and the pound-sign or hash mark always starts a directive or command.
Any help would be greatly appreciated. Thanks.
- I've done some developing with Jquery and so am not uncomfortable in using it. Unfortunately I'm not familiar with all of the syntax of javascript/jquery (especially more advanced features) and I want to figure out what some code is doing. Here's the code that I'm uncertain about:(function(window, $, PhotoSwipe)
{
$(document).ready(function()
{
var options = {};
$("#Gallery a").photoSwipe(options);
}
);}(window, window.jQuery, window.Code.PhotoSwipe)
);I don't understand exactly what this code is doing with or for the PhotoSwipe widget(for lack of a better word). I want to use it and integrate it with some other jquery code that I've written to retireve a list of images, for interactive display on a mobile site page. My other code works already but now I'm having problems getting the PhotoSwipe-related code to work with it. Any help would be appreciated. So I'm hoping to either get some information or be pointed to some documentation for either javascript or JQuery which might explain some of the syntax shwon in the code above. Thanks.- I took a look at the documentation for plugins authoring and am trying to duplicate the maxHeight plugin shown there, slightly modified, but can't seem to get it to work. I've looked at multiple previous entries about the plugins authoring documentation and still can't seem to get it to work. I'm using JQuery version 1.8.3 and I've put my code on a very simple test page which has only three div's within it. Each div has an "id" attribute defined for it(with values of div1, div2, and div3). Each div also contains an unordered list and each list has a different number of "li" entries in it, when compared with the other two. I also have "jQuery.noConflict()" turned on as well, in the very first liine of the code. Due to the hash mark(#) being a special character which precedes all velocity directives(the primary server-side language for our content management system) I have coded it as "${esc.h}" (which is a good escape character for the hash, in our cms) in the selector coded in the second to last line below. My code looks like this:var jq = jQuery.noConflict();(function( jq )
{
jq.fn.maxHeight = function()
{
var htmax = 0;
this.each(function()
{
htmax = Math.max( htmax, jq(this).height() );
alert("MAX=" + htmax + " !...");
});alert("MAX-HEIGHT FUNCTION ENTERED !...");return htmax;
};})(jQuery);
var tallest = jq('${esc.h}div[id]').maxHeight();alert("TALLEST=" + tallest + " !...");When it executes the plugin seems to get called just fine, but I'm seeing only the last two alerts shown in the code, and the one inside the ".each()" function is not being displayed at all. If it were working properly I would have expected it to have executed three times. Once for each div on the page.So I'm trying to figure out why the function coded inside the "this.each(" is not executing properly.Thanks for the help.- This is my first attempt at trying to use a tooltip and I must not be doing something right, because I haven't gotten it to work yet. I'm currently using JQuery 1.8.3 along with JQuery UI 1.9.2.custom.js. My code for trying to display it looks like this(JQuery.noConfllict is currently turned on so jq represents my reference to JQuery):jq( aslctr ).tooltip("option",{ content: reqName, show: { duration: 1000 }, position: { my: "left+100 center+10" } } );
jq( aslctr ).tooltip( "open");Based on the documentation I think I have most of the code above correct, but the tooltip doesn't open as I would have expected it to. I'm trying to set up some of the tooltip options with the first line above and thought that the second line above should actually open the tooltip and display it, but so far that hasn't happened. Where are my mistakes?Thanks for the help.- I'm trying to use the filter method to filter out unwanted anchor elements that I'm trying to manipulate on a page. My selector looks like this:jq('a${esc.h}id').filter(/\D{3}\d{3}\D{5}/).each(function()
{........});I have tried to create a regular expression to use in the filter, but it must wrong because when I try and display the page without the filter and regular expression it works fine. But it doesn't work when I add them to the existing selector. The regular expression is supposed to filter out all anchors which have id attribute values which aren't of the format 3 alphabetic characters followed by three digits followed by five alphabetic characters. Can someone suggest a comprehensive site or some very detailed documentation on how to build regular expressions, or suggest a possible fix to the code above? Thanks for the help.- If I have an anchor element on a page is it possible to pass that anchor element as "this" as a parameter to a custom javascript function, so that I can get its attribute information out of it from within the function? I'm trying to come up with a way to code a simple generic function call, that will allow me to then access the element's attribute information from within the function, for further processing. I'm currently trying to code the call in the anchor like this:<a href="javascript:findLinkPosn(this);" id="thisid">link text</a>and the function code looks like this:function findLinkPosn(elmnt)
{var id = elmnt.id;}but it doesn't work. I realize that "this" is a reserved word and that I may not be able to use it directly in a function call, but so far I'm stumped as to how to pass a good value referencing the specific anchor clicked, to the function. Thanks for the help.Our website is built on a content management system called dotcms. I’m working in a dotcms version 2.2 environment and I’m logged into the administrative portal and am testing a new JQuery mobile page. The language I use to write our widgets, for the site is velocity and both the dollar-sign (“$”) and the hash mark (“#”) are on every line of code depending on whether I’m referring to a variable(all variables start with a “$”) or issuing a directive(directives all begin with a “#”). So when writing code using JQuery everytime a dollar-sign is needed I have to code it like this:
${esc.d}
which also makes things more difficult when trying to use JQuery. I’m have been using JQuery 1.7.2 with the “noConflict()” option for a few months with no real problems, because our site also uses other javascript libraries, including at least one older version of JQuery.
Now we’re getting ready to add some new pages just for mobile devices, and I’m trying to figure out how to start using jquery.mobile-1.2.0 and not having much luck so far. According to the jQuery Mobile website version 1.2.0 is supposed to be compatible with jQuery-1.7.2. However when I add a line of javascript in the template on the page to put in a reference for where to find jquery-mobile then I’m getting errors. If I try to use the full version of jquery.mobile-1.2.0 with JQuery-1.7.2, I get this error from FireFox/FireBug:
this.loaderWidget is undefined
loading()jquery....2.0.js (line 948)
showPageLoadingMsg(theme=undefined, msgText=undefined, textonly=undefined)jquery....2.0.js (line 939)
initializePage()jquery....2.0.js (line 9085)
(?)()jquery....2.0.js (line 9140)
fire(context=Document test-request-mobile-page.html?mainFrame=true&livePage=0&language=1&host_id=39597d98-38a3-4686-ad7a-58f96de5af84&language=1&host_id=39597d98-38a3-4686-ad7a-58f96de5af84, args=[function()])jquery-1.7.2.js (line 1075)
fireWith(context=Document test-request-mobile-page.html?mainFrame=true&livePage=0&language=1&host_id=39597d98-38a3-4686-ad7a-58f96de5af84&language=1&host_id=39597d98-38a3-4686-ad7a-58f96de5af84, args=[function()])jquery-1.7.2.js (line 1193)
ready(wait=undefined)jquery-1.7.2.js (line 435)
DOMContentLoaded()jquery-1.7.2.js (line 949)
this.loaderWidget.loader.apply( this.loaderWidget, arguments );
jquery....2.0.js (line 948)
Then if I instead try to use the minified version of jquery.mobile-1.2.0 I get this error:
this.loaderWidget is undefined
silentScroll()jquery....min.js (line 2)
silentScroll(b=undefined, c=undefined, d=undefined)jquery....min.js (line 2)
silentScroll()jquery....min.js (line 2)
silentScroll()jquery....min.js (line 2)
fire(context=Document test-request-mobile-page.html?mainFrame=true&livePage=0&language=1&host_id=39597d98-38a3-4686-ad7a-58f96de5af84&host_id=39597d98-38a3-4686-ad7a-58f96de5af84, args=[function()])jquery-1.7.2.js (line 1075)
fireWith(context=Document test-request-mobile-page.html?mainFrame=true&livePage=0&language=1&host_id=39597d98-38a3-4686-ad7a-58f96de5af84&host_id=39597d98-38a3-4686-ad7a-58f96de5af84, args=[function()])jquery-1.7.2.js (line 1193)
ready(wait=undefined)jquery-1.7.2.js (line 435)
DOMContentLoaded()jquery-1.7.2.js (line 949)
..."ui-collapsible-collapsed",k),i.toggleClass("ui-collapsible-content-collapsed",k...
jquery....min.js (line 2)
So is there a problem with using these two versions together? The JQuery Mobile website says that they should be compatible. So I’m looking for any help that might allow me to resolve at least one if not both of the above listed errors, so I can make the page functional while still using jquery.mobile-1.2.0.I have looked at some of the forum history already but so far haven't found anything helpful.Thanks for the help.- 22-Jan-2013 10:37 AM
- Forum: Developing jQuery Mobile
I'm trying to use JQuery.Mobile-1.2.0 on my first mobile page and it doesn't seem to work.I'm working in a dotcms v. 2.2 (dotcms is a content management system that we use for our website) environment and I will need to start adding mobile pages sometime in the near future, so I'm trying to develop some prototype code now, so I'll have it in the future when I need it.I have the jquery.mobile-1.2.0 code library copied to a folder on our website. the code at the top of my new page's definition (according to the book JQuery Mobile Web - Development Essentials) all looks like this:<!DOCTYPE html><meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport"/><link rel="stylesheet" href="/global/jquery-mobile/jquery.mobile-1.2.0.min.css" />
<script type="text/javascript" charset="utf-8" src="/global/jquery/jquery-1.7.2.js"></script>
<script type="text/javascript" charset="utf-8" src="/global/jquery-mobile/jquery.mobile-1.2.0.min.js"></script>In conjunction with it I'm also currently using JQuery-1.7.2 (which is also referenced on the new mobile test page as shown above). The actual JQuery code that I have placed on the page is also currently setup to cause no conflicts with other libraries like this:var j = JQuery.noConflict();When I comment out the jquery.mobile-1.2.0.js reference the page functions properly with only the jquery-1.7.2.js reference being active and shows all of the correct labeling, controls, etc. But when I uncomment the reference to jquery.mobile-1.2.0.js , to make it active the page only displays as a completely blank page.I would appreciate any suggestions as to how to better diagnose this problem. Thanks for the help.- 11-Oct-2012 11:13 AM
- Forum: Getting Started
I have a simple webpage with a form on it. The form has two select boxes for use as filters, when submitting a query to the server. Each select has an "onChange" handler coded for it dynamically, when the form originally loads (using document.ready). Whenever either selects' value changes a request is submitted using both selects current values. My problem seems to be that whenever I click a value in one select, without the other select already having had one of its values selected, the select which has not previously had a value chosen for it, is having a value of "undefined" returned from it and used as a parameter in the query that it is submitted with and so nothing is returned from the query using that bad value, as a parameter. I've already tried checking the field value for an empty string(value="" or length not > 0), but that didn't work.So my question is how can I check both fields for a bad or invalid value of "undefined" so I can react appropriately and either display and error or format a default value for that parameter in the query?Thanks for the help.- 24-Sep-2012 12:37 PM
- Forum: Getting Started
I have a proxy page from which I make a request to a target page to capture html in a specific "DIV". The desired html is returned to the proxy page just fine. The html captured is a list of name links, with a hidden div associated with each link. The hidden "div's" each have a unique identifier associated with them. When one of the links is clicked a javascript function is supposed to execute which will take the name from the link and retrieve some more data which is then supposed to be appended to the unique "div" associated with the name link clicked, and then the "div" in question is to be expanded and displayed(previously(before the link is clicked) it was hidden). So far I heven't been able to successfully append the new data into the selected link's div and see it displayed. Is it possible to do this? I ask because I was wondering, if since the list of links with div's was not original to my proxy page, that maybe they couldn't be seen for some reason by a JQuery selector?Thanks for the help.What's the best way to generate html code along with dynamic data (from one or more JSON objects) and add it to a page? Is "document.write()" better than using some of the JQuery methods like prepend, append, etc., for such purposes?
- I have a JSON object coming in called "data" which looks like this in the console:
{"hourslist":[{"sortdayofweek":" tuesday thursday","sorttime":"9:50 p.m.","officehoursinfo":"9:50 p.m.-10:20 p.m.<br>Administration Building, Room 1224"},{"sortdayofweek":" tuesday thursday","sorttime":"2:30 p.m.","officehoursinfo":"2:30 p.m.-4 p.m.<br>Administration Building, Room 1224"}]}
I want to assign a new variable to the "hourslist" array object in the javascript object produced by this statement:var indata = ${esc.d}.parseJSON(data);So far Ive tried getting at it by using this:var inhourslist = indata["hourslist"];
and this:
var inhourslist = indata.hourslist;
both to no avail. So how do I get at it? The JSON object originally coming in (shown initially above) seems to be coming
into my success callback just fine.
But so far I have not figured out how to reference it successfully so that I can actually use it or manipulate it.
Is there something unique about Javascript objects and referencing them and their contents, when created from JSON objects?
Thanks for the help.
- 20-Sep-2012 11:35 AM
- Forum: Getting Started
I have a test page on which I have added server-side code (written in velocity) to format and place a JSON object, on it. The object itself visually looks like this when I send some input to it manually:{"hourslist":[{"sortdayofweek":" wednesday","sorttime":"5:30 p.m.","officehoursinfo":"5:30 p.m.-8:30 p.m.
College Center 202"}]}Which is correct for what I've put into. It should be a map containing a list of one or more map entries, which it appears to be visually. Now my question is why do I keep getting back an error response from this page on my "$.ajax()" call to it?I have placed alerts in both my "success" and "error" callback functions and so far I'm only getting back error responses. In the first error callback alert I wanted to see what the jqXHR, TextStatus, and Error Thrown were and am getting this:GOT JSON CALL ERROR RESPONSE..jqXHR=[object Object] TEXT-STATUS=parsererror ERROR-THROWN=SyntaxError: JSON.parse: unexpected character !...In the second error alert I decided to look at the jqXHR.responseText just to see if I could tell why, because it gives me a lot of that is not on my target page, but instead could be from my page which submits the original JQuery request. It looks like this:JQXHR-TEXT=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>login</title><meta name="keywords" content="
" /><meta name="description" content="
" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/global/css/reset-fonts-grids.css" /><link rel="stylesheet" type="text/css" media="screen" href="/global/css/global.css" /><link rel="stylesheet" type="text/css" media="screen" href="/global/css/template.css" /><link rel="stylesheet" type="text/css" media="screen" href="/global/css/navigation.css" /><link rel="stylesheet" type="text/css" media="screen" href="/global/css/sections.css" /><link rel="stylesheet" type="text/css" media="screen" href="/global/css/ie.css" /><link rel="stylesheet" type="text/css" media="print" href="/global/css/print.css" /><link rel="stylesheet" href="/html/js/lightbox/css/lightbox.css" type="text/css" media="screen" /><script type="text/javascript" src="/html/js/scriptaculous/prototype.js"></script><script type="text/javascript" src="/html/js/scriptaculous/scriptaculous.js"></script><script type="text/javascript" src="/global/js/navigation_js.js"></script><script type="text/javascript" src="/global/js/general.js"></script><script src="/urchin/urchin.js" type="text/javascript"></script><script type="text/javascript">var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-32885351-1']);_gaq.push(['_setLocalRemoteServerMode']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script>
</head><body class="cols1"><!-- the id on the containing div determines the page width. --><!-- #doc = 750px; #doc2 = 950px; #doc3 = 100%; #doc4 = 974px --><div class="firstBg"><div id="doc4" class="yui-t3"><!-- START page header --><div id="hd"><div class="header"><a href="http://www.stchas.edu"><img src="/global/images/template/logo.png" alt="logo" width="235" height="125" class="logo" /></a>
<!-- stOpen --><div id="studentTools" ><a href="#" onclick="showHideTopDiv('studentTools');setSTCookie();" class="right"><img src="/global/images/template/btn_icn_close.gif" alt="btn_icn_close" width="21" height="21"/></a><ul><li><a href="http://www.stchas.edu/academics/student-resources/computer-help-desk/cougarmail.html">Cougar Mail</a></li><li><a href="http://www.stchas.edu/academics/student-resources/scc_connection ">SCC Connection</a></li><li><a href="http://www.stchas.edu/academics/student-resources/library/">Library</a></li><li><a href="https://moodle.stchas.edu/">Moodle</a></li><li><a href="http://www.stchas.edu/academics/student-resources/computer-help-desk/index.html">Help Desk</a></li><li><a href="http://www.stchas.edu/calendar/">Events Calendar</a></li></ul><!--<a href="#" onclick="showHideTopDiv('studentTools')"><img src="/global/images/template/btn_close.gif" alt="btn_close" width="86" height="30"/></a>--></div>
<div class="siteTools"><ul class="buttoms"><li id="applyLink"><a href="http://www.stchas.edu/admissions/application-for-admission.html">Apply Now!</a></li><li id="azLink" class="down"><a href="#" id="azIndex_ref" onclick="showHideTopDiv('azIndex')" >A-Z Index</a></li><li id="directoryLink" class="down"><a href="#" id="directory_ref" onclick="showHideTopDiv('directory')">Directory</a></li><li id="studentLink" class="down"><a href="#" id="studentTools_ref" onclick="showHideTopDiv('studentTools');setSTCookie();">Student Tools</a></li></ul><div class="search"><form id="googleSearch" name="googleSearch" method="post" action="/home/search-results-google-cse.html"><input type="text" name="search" id="search" size="20" alt="Search Box" /><input type="submit" value="Go" class="searchButton" /></form></div><div class="positionFix"> <!-- Just to fix the ie6 and 6 not show problem -->
<div id="azIndex" class="siteToolsSub" style="display:none"><script type="text/javascript">function validateEnterAZ(e){if (e.keyCode == 13){searchAZSiteTools();}return false;}function searchAZSiteTools() {keyWord = document.getElementById('azIndexSiteToolsSearch');if (keyWord.value == null || keyWord.value == '' || keyWord.value == 'Enter Keyword') {alert('Please add a valid keyword');keyWord.focus();} else {document.getElementById('azSearchResultFrame').src = '/home/az_index_sitetools.html?azKey=' + keyWord.value;}}</script><a href="#" onclick="showHideTopDiv('azIndex')" class="right"><img src="/global/images/template/btn_icn_close.gif" alt="btn_icn_close" width="21" height="21"/></a><h4>A-Z Index</h4><div class="yui-gd"><div class="yui-u first"><!--<form id="searchAZ" name="searchAZ" method="post" action="#">--><input type="text" name="azIndexSiteToolsSearch" id="azIndexSiteToolsSearch" size="20" alt="AZ Index Search" onKeyDown="validateEnterAZ(event);" /><a href="javascript:searchAZSiteTools()" class="go">Go</a><!--</form>--><p>To narrow your search, enter a search term in the box above and click on go or click on a letter of the alphabet to move to that section of the index.</p></div><div class="yui-u"><p class="abc"><a href="/home/az_index_sitetools.html?letter=a" target="azSearchResultFrame">A</a><a href="/home/az_index_sitetools.html?letter=b" target="azSearchResultFrame">B</a><a href="/home/az_index_sitetools.html?letter=c" target="azSearchResultFrame">C</a><a href="/home/az_index_sitetools.html?letter=d" target="azSearchResultFrame">D</a><a href="/home/az_index_sitetools.html?letter=e" target="azSearchResultFrame">E</a><a href="/home/az_index_sitetools.html?letter=f" target="azSearchResultFrame">F</a><a href="/home/az_index_sitetools.html?letter=g" target="azSearchResultFrame">G</a><a href="/home/az_index_sitetools.html?letter=h" target="azSearchResultFrame">H</a><a href="/home/az_index_sitetools.html?letter=i" target="azSearchResultFrame">I</a><a href="/home/az_index_sitetools.html?letter=j" target="azSearchResultFrame">J</a><a href="/home/az_index_sitetools.html?letter=k" target="azSearchResultFrame">K</a><a href="/home/az_index_sitetools.html?letter=l" target="azSearchResultFrame">L</a><a href="/home/az_index_sitetools.html?letter=m" target="azSearchResultFrame">M</a><a href="/home/az_index_sitetools.html?letter=n" target="azSearchResultFrame">N</a><a href="/home/az_index_sitetools.html?letter=o" target="azSearchResultFrame">O</a><a href="/home/az_index_sitetools.html?letter=p" target="azSearchResultFrame">P</a><a href="/home/az_index_sitetools.html?letter=q" target="azSearchResultFrame">Q</a><a href="/home/az_index_sitetools.html?letter=r" target="azSearchResultFrame">R</a><a href="/home/az_index_sitetools.html?letter=s" target="azSearchResultFrame">S</a><a href="/home/az_index_sitetools.html?letter=t" target="azSearchResultFrame">T</a><a href="/home/az_index_sitetools.html?letter=u" target="azSearchResultFrame">U</a><a href="/home/az_index_sitetools.html?letter=v" target="azSearchResultFrame">V</a><a href="/home/az_index_sitetools.html?letter=w" target="azSearchResultFrame">W</a><a href="/home/az_index_sitetools.html?letter=x" target="azSearchResultFrame">X</a><a href="/home/az_index_sitetools.html?letter=y" target="azSearchResultFrame">Y</a><a href="/home/az_index_sitetools.html?letter=z" target="azSearchResultFrame">Z</a></p><iframe name="azSearchResultFrame" id="azSearchResultFrame" width="370" height="290" src="/home/az_index_sitetools.html" frameborder="0" marginheight="0" marginwidth="0" scrolling="no">Please update your Browser</iframe><br /><br /><a href="#" onclick="showHideTopDiv('azIndex')"><img src="/global/images/template/btn_close.gif" alt="btn_close" width="86" height="30"/></a></div></div></div>
<div id="directorAll of which appears to be code I would find on many other pages on our site, but not my test page. Is there anyway to determine where it's getting this code from? Or is there a way to verify that the JQuery request is only going to the correct test page somehow, in addition to just coding the url correctly?Thanks for the help.- 18-Sep-2012 03:56 PM
- Forum: Getting Started
I want to retrieve a JSON object from another page using either the ".getJSON()" method or the ".ajax()" method with a "dataType:json" parameter to retrieve the JSON object. When the request to retrieve the JSON object is executed how will it know where to find the JSON object? I've not seen an example that shows exactly how the JSON object needs to be stored or placed on the original page which will be generating it. Does it just look for the first or all JSON objects that it finds on the target page and return them all, based on their data type, or do I need to place the object(s) within a specific set of tags similar to when retrieving html? Please explain. Thanks.- I'm trying to use the ".getJSON()" method for the first time and so far I'm not getting anything out of it. I know the callback function for it is supposed to be called when the call succeeds, but can I also code an error callback function for it, or instead of doing that should I just use the more general ajax method and then code callback functions for both success and error, and make the dataType JSON? Thanks for the help.
- Do I need any new plugins in order to use the ".getJSON()" method in Firefox? Currently I'm trying to pull back JSON data from a target and the following statement:${esc.d}.getJSON(targetUrl,function(jsonData,status,xhr)
{
alert("JSON-DATA=("+jsonData+") !...");
}
);is apparently not working because I do not get an alert when I run it.- 13-Sep-2012 12:23 PM
- Forum: Getting Started
I have a table on a page into which I'm loading a list of TR's with links and with div's from a table on another page. The links all have names and unique identifiers associated with them and within each of them is a div which also has a unique identifier (the id attribute) associated with it. Now this list loads and displays fine on my original page. When I click a link on the list another JQuery request to another page is issued passing the name to the target page as parameters. It's supposed to then "load" the html generated from this request to the target page back into the original unique div on my original page associated with the name link clicked.My question is, is this possible to do, since the "DIV" I'm trying to load this target page data into is not original to the page but was itself originally loaded from another target page? If so then my selector must be wrong. Please advise and thanks for the help.- 24-Aug-2012 01:29 PM
- Forum: Getting Started
I have an existing page on a website which I'm trying to hit from a proxy page using JQuery requests. The target page produces a list of data link results which are retrieved using two filter/select boxes. Sometimes the resulting list is a page (20 items) or less and sometimes it is multiple pages in length, which results in some paging links also being generated on the original target page. Currently my proxy page pulls in the data results just fine, as well as the original paging links with my first "(document).ready" request.I'm having problems with synchronizing a second "(document).ready" request which will capture the text of the original paging links, so they can be changed to function properly and submit the proper JQuery paging requests again back to the original target page. If I put an alert at the top of my second "(document).ready" request code then I can see first the search results data and then a second or two later the paging links loaded onto my proxy page. With the alert coded my code finds and changes the paging links correctly. Wthout the alert my code does not find the original paging links text at all, when it executes, so I suspect that my code which is supposed to process the paging links needs to have a delay added tothe top of it, or at the end of the first "(document).ready" request which is suposed to pull in the links. So far I have tried several things like using ".delay() with a custom queue", and ".wait()" all to no avail.So can someone point me to a good working example of how to synchronize a "(document).ready" request to only start after the contents of an element on a proxy page have finished loading and being pulled from a target page? So I'm starting over with my second "(document).ready" request. My first request code cna be found here: http://pastebin.com/8tCWTt2q . Thanks for the help.- 06-Aug-2012 02:41 PM
- Forum: Getting Started
I have the following code on a website in a test search page associated with a search filter on the page:${esc.d}('${esc.h}productSearchResults').empty();
${esc.d}('${esc.h}productSearchResults').load('test-ajax-products-page.html ${esc.h}testDataResults');The first time in it works almost perfectly with most of the expected data coming back from the "#testDataResults" div of the "test-ajax-products-page.html" page which is a target test page. The second or more times that the search filter is executed the destination "#productSearchResults" div on the original test search filter page remains unchanged even though the JQuery request seems to still be working ok. So my question is why is my destination div "#productSearchResults" on my test search page not displaying the new html data coming back from the test query page ("test-ajax-products-page.html") which I can see coming back properly by displaying them in an alert? I'm assuming that I probably have a syntax or other type of error, in my code, but have not yet been able to figure it out, especially since it does seems to work properly the first time in.- I'm very new to JQuery and am trying to get a test page to work using code found in a DOTCMS/JQuery tutorial. As part of the tutorial I have the following piece of code in one of the code blocks:var url = "test-ajax-products-page.html";${esc.d}.ajax( { url: url, type: "GET", data: "cat="+cat, dataType: "html", success: function(data) {
${esc.d}('${esc.h}productSearchResults').html(data);}});I'm not sure I completely understand what this part:${esc.d}('${esc.h}productSearchResults').html(data);is actually supposed to do with the data or what it is expecting the data to be, and so far haven't been able to find anything much on what ".html()" does exactly, or other alternatives to using it. Can someone please clarify this or possibly point me to information on ".html()" or other alternatives to it?- «Prev
- Next »
Moderate user : n0vice.1
© 2012 jQuery Foundation
Sponsored by
and others.



