Find me a handle in .js file

While minifying script files I need to prevent a .js file from it. The instructions ask me to put in the Handle name and not the filename. Can anyone please help me out?

(I did not know whether I should post it here or in WordPress section.)

Handles are abstract and typically only relevant to the OS’s memory of which they’re stored on

How does this reply help me? please do not put unclear and vague statements that do not help to solve the problem. It frustrates.:injured:

JavaScript itself doesn’t have handles. It is whatever application you are using that has defined the handle you need to reference. Without knowing what application you are referring to it is impossible to know where you need to go to find the handle.

I’m not 100% sure, but after browsing around a bit (esp http://codex.wordpress.org/Function_Reference/wp_enqueue_script) and checking wp-cycle.php (esp the line wp_enqueue_script('cycle', WP_CONTENT_URL.'/plugins/wp-cycle/jquery.cycle.all.min.js', array('jquery'), '', true); ), I think the handle you’re looking for is ‘cycle’

It helps you by letting you know that your question is as vague as the answer you’ve received. I’ve told you what a handle is and I’ve explained to you that JS isn’t typically written with reference to handles by letting you know that OS’s usually create the handles rather than scripts.

I may be wrong but i doubt “cycle” is the handle.
As an assembly programmer, what i know about handles tells me that what you’re looking for is going to be a seemingly random hex string . i.e. “723FA1-3D4CBC-6FF23A-411DFA”
The handle will be stored in memory(RAM) on the wordpress server at the time of script execution. (Like I said before…)

Unless you have some other enlightening information to provide about exactly what you’re trying to do or what you mean by “handle” than I doubt anyone will be able to help you much.

I believe the information you’re looking for is probably the reference value of the script object.
If you’re attempting to prevent access to a certain script you’re going to be defeating yourself by creating the object within the script you want to block.
Otherwise you’ll have to invoke an OS call along the lines of “CreateFile()” which will instantiate said “handle” in memory on the server.

Could you point me towards the directions you speak of?

What can I say? I am a newbie and have no idea what more to add. I had uploaded the message pic and the script in question. Looking at your replies it appears the programmer who created the minifying script is at fault. I think he should have given some sample of what he expects, then maybe you all could have helped.

Just curious, have you tried ‘cycle’ ?

No. I think I should try contacting the author. I am scared of seeing unexpected behavior so I decided not to “try”.

More context is required. Can you please show us more from where your instruction came from?

To ignore a script, just copy the handle (not the filename!) and put it in the ‘Scripts to be ignored’ box on a separate line.

I just tried it on a fresh WP 3.1.3 install with Better WordPress Minify (I assume that’s the one you’re using) and WP-Cycle and I put the word ‘cycle’ in the text box ‘Scripts to be ignored (not minified)’ and that works as expected, see code below:


<script type='text/javascript' src='http://wp/wp-content/plugins/[b]bwp-minify[/b]/min/?f=wp-includes/js/admin-bar.js'></script> 
<script type='text/javascript' src='http://wp/wp-content/plugins/wp-cycle/jquery.cycle.all.min.js?ver=3.1.3'></script> 

(check how “bwp-minify” is not in the second src)

Thanks for the input ScallioXTX. I will try and inform you of the result.

Thanks ScallioXTX. I will try and report back.

Sorry, it did not work. First I used the bottom code with wp-cycle and then both. Once I put the code and update, the code vanished from the window and the image rotator stopped.
see it here: Free Accident Insurance | Prevent Accidents, Injuries & Trauma

May be there are some other settings and/or conflicts on my site. But I have no idea

Your code is still being minified. Did you use ‘cycle’ (~not~ ‘wp-cycle’), and fill that in in the field ‘Scripts to be ignored (not minified)’ ?
(see attachment for my working settings)

And indeed it may be a conflict with some other script, but I can’t see that from here …

Sorry Sir, it does not work. The rotator is unoperative.

I see, but it doesn’t work because the page has an error: jQuery is not defined (it says so in the JS console of chrome)

And that error is caused by the minify script not working. The JS url returns an HTTP 400 error, saying the request is not valid. So you don’t get jQuery, and the plugin doesn’t work because it’s dependent on jQuery.

I had the same problem, and fixed by changing line 65 of wp-content/plugins/bwp-minify/min/config.php to:


$min_documentRoot = realpath(dirname(__FILE__).'/../../../..');

But at least what we set out for is working now: the js script is not minified, so we have established that it’s handle is, indeed, ‘cycle’ :smiley:

If I read you correctly, the handle name provided is “cycle”, yet the minify plugin cannot isolate and blocks the needed jquery.

Till now I have tried this one and wp-minify. Do you know of any better plugins, as I just have the option of NOT minifying altogether.

jQuery doesn’t load because the minify plugin doesn’t work correctly (because it assumes there is a setting available in PHP – $_SERVER[‘DOCUMENT_ROOT’] to be precise – which is not available on your system, for whatever reason).
The change I proposed in my previous post to line 65 to config.php solves that problem and if you do that the plugin works (at least it does on my system), and everything is good to go.

As for the other minify plugins, I have no idea; I’ve never really looked for any.

Sir
Thanks for your reply. Could you help one last bit more? Please help me configure the setting you told:

"$min_documentRoot = http://www.mysite.com/…'); "

is this what I have to enter?