Hi,
I'm having trouble running a jQuery script in RH9.
I'm trying to run a jQuery script in RH9 but it doesn't do anything in the RH Previewer (Ctrl+W). When I generate a chm, the topic displays an error message when displaying the topic.
The short script I'm running is this:
$.get('rhvariable.apj', function(data)
{
var xml_data = data;
$(xml_data).each(function(){
if($(this).find('name').text() == 'Laser_Version') {
var release_Version = ($(this).find('value').text());
alert('The current Release Version is: ' + release_Version);
}
});
});
Essentially, I'm opening the XML-based User Defined Variable .apj file and locating and returning the version # of our product from it that I'll use to insert into a form that comes up for user feedback.
The script runs beautifully when the file's opened in IE11, Chrome or FireFox so I know it's correct. However, when I run it from a RH9 compiled help (.chm), I get this error message:
![]()
I originally had the initial line as "jQuery.get" which gave me the same error only it flagged the jQuery property as undefined.
When I changed it to "$.get" I get the above error message.
I also tried to enclose it within a function:
$function()
{
$get(...
{
.
.
.
]);
});
The Error description was simply '$' is undefined
If I run it within the RH9 Previewer (Ctrl+W), nothing happens - no error message but the page does display.
I'm using the latest jQuery min file: "jquery-1.12.0.min.js"
Thanks in advance!!!