vendredi 26 décembre 2014

Jquery Ajax working on localhost but refuses to work on server


I have an encoded data that has to be sent by Ajax to a route which is in the end send via a controller to a function.


WebPage=>Click Button=>Ajax Request=>route=>Controller



var val=eval("CKEDITOR.instances.content"+id+".getData()");
$.ajax({
type: "POST",
url: "/xarticle",
data: {
id:id,
val:val,
column:"content"
},
success:function(data){
data=Number(data);
}
});

//the encoded data

%3Cp%3E%3Cimg+alt%3D%22%22+src%3D%22%2Fjs%2Fimported%2Fckeditor%2Fplugins%2Fdoksoft_uploader%2Fuserfiles%2F96546165_large_4171694_prodykti_sjigaushie_jiri.jpg%22+style%3D%22float%3Aleft%3B+height%3A338px%3B+width%3A450px%22+%2F%3E%3C%2Fp%3E%0A%0A%3Cp%3EFirst+and+foremost+key+to+fast+metabolism+is+the+right+correlation+of+%3Cstrong%3Eprotein%3C%2Fstrong%3E%2C+%3Cstrong%3Efat%3C%2Fstrong%3E+and+%3Cstrong%3Ecarbohydrates%3C%2Fstrong%3E.%26nbsp%3B+To+reach+the+balance+here+will+help+a+classic+formula%3A+for+every+1+g+of+protein+come+3.5+g+of+carbohydrates+and+around+0.8+g+of+fats.+The+amount+of+proteins+shouldn%26rsquo%3Bt+comprise+more+than+25-33%25+from+the+whole+meal.%26nbsp%3B+In+case+the+amount+of+fat+and+carbohydrates+is+exceeded+you+will+be+gaining+weight.+For+example%2C+you+eat+a+lot+of+salads-absolutely+healthy+food.+But+you+keep+on+putting+on+those+pounds.+Let+me+guess%2C+you+are+pouring+5-6+table+spoons+of+oil+to+add+some+taste+to+every+salad.+Well%2C+that+is+a+problem+in+fact.+The+majority+of+diets%2C+by+the+way%2C+are+based+on+shrinking+the+amount+of+fat+and+carbohydrates.%3C%2Fp%3E%0A%0A%3Cp%3EI+know+it+seems+quite+time-consuming+to+count+all+those+proteins%2C+fats+and+carbohydrates.+However+it+is+enough+to+make+sure+that+fats+don%26rsquo%3Bt+prevail+upon+proteins.+To+make+it+even+easier%2C+you+might+choose+as+well+beforehand+a+dozen+of+meals+which+approximately+would+correspond+to+the+above+%26ndash%3Bmentioned+formula.+In+both+ways+for+the+majority+of+working+people+the+everyday+menu+doesn%26rsquo%3Bt+vary+that+much.%3C%2Fp%3E%0A%0A%3Cp%3E%3Cstrong%3EIron%3C%2Fstrong%3E%3C%2Fp%3E%0A%0A%3Cp%3ESecondly%2C+for+faster+metabolism+consume+more+foods+with+high+level+of+iron.+This+element+carries+oxygen+to+our+cells+and+in+case+there%26rsquo%3Bs+a+lack+of+it+the+metabolism+gets+slower.+Remember%3A+woman%26rsquo%3Bs+body+requires+more+iron-average+day+norm+for+a+woman+is+18+g+while+for+man+8+g+is+enough.+Among+food+rich+in+iron+are+the+following%3A%3C%2Fp%3E%0A%0A%3Cp%3E-+Clams%2C+canned%2C+drained%3B%3C%2Fp%3E%0A%0A%3Cp%3E-+Fortified+instant+cooked+cereals+(various)%3C%2Fp%3E%0A%0A%3Cp%3E-+Cooked+oysters%3B%3C%2Fp%3E%0A%0A%3Cp%3E-Liver%3B%3C%2Fp%3E%0A%0A%3Cp%3E-+Dried+pears+and+apricots%3B%3C%2Fp%3E%0A%0A%3Cp%3E-Prune%3B%3C%2Fp%3E%0A%0A%3Cp%3E-+Red+lentils%3B%3C%2Fp%3E%0A%0A%3Cp%3E-Spinach%3C%2Fp%3E%0A%0A%3Cp%3EEtc.%3C%2Fp%3E%0A%0A%3Cp%3E%3Cstrong%3ECalcium%3C%2Fstrong%3E%3C%2Fp%3E%0A%0A%3Cp%3EThe+third+important+accelerator+of+metabolism+is+calcium.+It+burns+the+excess+of+fats+in+our+body.+The+lack+of+this+element+causes+the+craving+for+sweets+which%2C+as+everyone+knows%2C+contributes+to+our+weight+gain.+One+can+find+calcium+in+fat-free!+Dairy+products%2C+particularly+%3Cstrong%3Ecottage-cheese%3C%2Fstrong%3E.+Another+food+even+richer+in+calcium+is+%3Cstrong%3Esesame%3C%2Fstrong%3E%2C+the+ground+one+for+better+digestion.+100+g+of+this+product+will+provide+for+you+calcium+enough+for+the+whole+day.+For+it+is+rather+hard+to+imagine+eating+sesame+in+such+quantity+you+can+substitute+it+with+%3Cstrong%3Esesame+milk%3C%2Fstrong%3E%3A+soak+in+water+sesame+for+the+whole+night%2C+and+in+the+morning+grind+it+all+together+in+blender+(called+milk+because+of+the+meal%26rsquo%3Bs+color).%3C%2Fp%3E%0A%0A%3Cp%3E%3Cstrong%3EPotassium%3C%2Fstrong%3E%3C%2Fp%3E%0A%0A%3Cp%3EIt+doesn%26rsquo%3Bt+influence+metabolism+directly+but+only+participates+in+regulating+water+balance+of+your+body.+If+your+organism+is+dehydrated+then+the+metabolism+gets+a+way+slower.+So+there+is+no+way+to+go+without+it.+The+dietary+source+of+this+element+is+%3Cstrong%3Ebanana%2C+potato%2C+citrus+%3C%2Fstrong%3Eand%3Cstrong%3E+dried+fruits%3C%2Fstrong%3E.%3C%2Fp%3E%0A%0A%3Cp%3E%3Cstrong%3EWhat+makes+it+go+slower%3C%2Fstrong%3E%3F%3C%2Fp%3E%0A%0A%3Cp%3ELike+there+is+food+boosting+our+metabolism+some+other+food+has+an+opposite+effect.+Here+we+usually+mention+fatty+animal+source+foods-%3Cstrong%3Efat+meat%3C%2Fstrong%3E%2C+%3Cstrong%3Ebutter%3C%2Fstrong%3E%2C+%3Cstrong%3Ecream%3C%2Fstrong%3E%2C+%3Cstrong%3Esausages%3C%2Fstrong%3E%2C+%3Cstrong%3Echeeses%3C%2Fstrong%3E+etc.+%26nbsp%3BPretty+fat+are+%3Cstrong%3Epastries%3C%2Fstrong%3E+and+%3Cstrong%3Esweets%3C%2Fstrong%3E.%26nbsp%3B+Some+food+of+plant+origin+is+as+well+rich+in+fat.+%3Cstrong%3ENuts%3C%2Fstrong%3E+and+all+kinds+of+%3Cstrong%3Evegetable+oils%3C%2Fstrong%3E+have+always+to+be+limited+in+your+everyday+meal.+So+avoid+all+those+foods+in+case+you+want+to+boost+your+metabolism+but+not+on+the+contrary.%3C%2Fp%3E%0A


The issue I am facing is that everything works like a charm on the localhost but on the server things start getting bad. I start getting 404 Errors that this routes does not exist when this value is assigned to val. however everything works perfectly when i have a small sentence, or the encode is short but something as big as this one throw me with an error


Somone please give me at least one suggestion what can it be ?





Aucun commentaire:

Enregistrer un commentaire