[Solved] how do i split the url using split method by checking all the image extension

You can always try to do it like this; var imgUrl = “http://sits/productimages/00670535922278.png?sw=350&sh=350;”; var splitterArray = [‘.jpeg’, ‘.png’, ‘.jpg’, ‘.gif’]; for (var i = 0; i < splitterArray.length; i++) { var imgUrlArray = imgUrl.split(splitterArray[i]); if (imgUrlArray.length > 1) { //Do your thing here } } You use a array of your extensions that will be … Read more

[Solved] how to close the div in DOM JQuery [closed]

$(‘<li />’, {‘class’: ‘liBullet’}).append( $(‘<div />’, {‘class’: ‘layerCheck’}).append( $(‘<input />’, {id: layer.id, type: “checkbox”}) ) ).append( $(‘<label />’, {‘for’: layer.id, text: layer.name}) ).append( $(‘<div />’, {id: ‘legend’ + layer.id, ‘class’: ‘loadingLegend’}) ).appendTo(“#layer_list”); FIDDLE 1 solved how to close the div in DOM JQuery [closed]

[Solved] How can I optimize my javascript object? [closed]

function field($sel){ //field odject var $field = $($sel); var offset = $field.offset(); var field = { width: $field.width(), offsetTop:offset.top, offsetLeft: offset.left, offsetRight: offset.left + $field.width(), offsetBottom: offset.top + $field.height() }; return field; } You extend your functionality by creating a constructor and return the object from your function. 3 solved How can I optimize my … Read more

[Solved] Regex for this format [40]*100+ [closed]

This regexp tests for the format you describe: /^(\[\d{1,3}\]\*\d{1,3}\+)+$/ \d{1,3} matches up to 3 digits. We put one of these inside literal [], with literal * after that, and literal + after the second one. Then we use a quantified group to allow multiple repetitions. You can’t do the validation until the user has finished … Read more

[Solved] How to add local variables and a different function in script element in Javascript [closed]

You could just get the div element you want the code to be in, and then set the innerhtml to <script>your code here</script> EDIT: Try assigning your function like so: var myFunc = function() { //Code } Then you can call myFunc(parameters) 3 solved How to add local variables and a different function in script … Read more

[Solved] What is wrong with my jQuery code? Gives error that it’s not a function [closed]

Because $().value is undefined (not a function). The value property belongs to the HTMLInputElement DOM interface, jQuery objects don’t have any property or method by that name. jQuery objects provide the .val() method to set elements’ value property: $(‘.usp-title input’).eq(0).val(name); You may also get and set DOM element properties directly by retrieving a DOM element … Read more

[Solved] Css position div under element [closed]

When you give an element absolute positioning, you are pulling it out of the document flow, so that it’s positioned relative to its first parent element that is not positioned with the static value (the default for positioning). What you need to do is have another element that is creating flow that allows you to … Read more

[Solved] How to show a blue colored progress bar exactly like gmail’s horizontal blue colored progress bar which is displayed when user submits the form?

My question is different than any other question. I don’t know how to work the progress bar percentage or progress with the response time. I’m not getting solution for it from anywhere. Please remove the tag of duplicate from my question. No it’s not different, and therefore it is duplicate of show progressbar while loading … Read more

[Solved] XMLHttpRequest cannot load file:///C:/Users/hamma/Desktop/rao.html

According to your console output: XMLHttpRequest cannot load file:///C:/Users/hamma/Desktop/rao.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. That means that you are trying to run the file without a server i.e. file:///[…] and for security reasons you can’t run AJAX requests like that. You need to setup a … Read more

[Solved] Updating php values using jquery

If you are using sessions, you will need an ajax call that will call a php file within the session that will update a particular session variable. The issue at hand though is that it would not be an update until the next time the base page was loaded since that information would need to … Read more